Merge branch 'master' of git://factorcode.org/git/factor
commit
0ce6b3a12a
|
@ -81,9 +81,13 @@ M: string resolve-pointer-type
|
||||||
dup void? [ no-c-type ] when
|
dup void? [ no-c-type ] when
|
||||||
dup c-type-name? [ c-type ] when ;
|
dup c-type-name? [ c-type ] when ;
|
||||||
|
|
||||||
|
<PRIVATE
|
||||||
|
|
||||||
: parse-array-type ( name -- dims c-type )
|
: parse-array-type ( name -- dims c-type )
|
||||||
"[" split unclip
|
"[" split unclip
|
||||||
[ [ "]" ?tail drop parse-word ] map ] dip ;
|
[ [ "]" ?tail drop string>number ] map ] dip ;
|
||||||
|
|
||||||
|
PRIVATE>
|
||||||
|
|
||||||
M: string c-type ( name -- c-type )
|
M: string c-type ( name -- c-type )
|
||||||
CHAR: ] over member? [
|
CHAR: ] over member? [
|
||||||
|
|
|
@ -10,6 +10,10 @@ IN: alien.parser
|
||||||
: parse-c-type-name ( name -- word )
|
: parse-c-type-name ( name -- word )
|
||||||
dup search [ ] [ no-word ] ?if ;
|
dup search [ ] [ no-word ] ?if ;
|
||||||
|
|
||||||
|
: parse-array-type ( name -- dims c-type )
|
||||||
|
"[" split unclip
|
||||||
|
[ [ "]" ?tail drop parse-word ] map ] dip ;
|
||||||
|
|
||||||
: (parse-c-type) ( string -- type )
|
: (parse-c-type) ( string -- type )
|
||||||
{
|
{
|
||||||
{ [ dup "void" = ] [ drop void ] }
|
{ [ dup "void" = ] [ drop void ] }
|
||||||
|
|
|
@ -325,7 +325,7 @@ FUNCTOR: define-simd-256 ( T -- )
|
||||||
|
|
||||||
N [ 32 T c:heap-size /i ]
|
N [ 32 T c:heap-size /i ]
|
||||||
|
|
||||||
N/2 [ N 2 / ]
|
N/2 [ N 2 /i ]
|
||||||
A/2 IS ${T}-${N/2}
|
A/2 IS ${T}-${N/2}
|
||||||
A/2-boa IS ${A/2}-boa
|
A/2-boa IS ${A/2}-boa
|
||||||
A/2-with IS ${A/2}-with
|
A/2-with IS ${A/2}-with
|
||||||
|
|
|
@ -85,6 +85,13 @@ IN: tools.deploy.shaker
|
||||||
run-file
|
run-file
|
||||||
] when ;
|
] when ;
|
||||||
|
|
||||||
|
: strip-specialized-arrays ( -- )
|
||||||
|
strip-dictionary? "specialized-arrays" vocab and [
|
||||||
|
"Stripping specialized arrays" show
|
||||||
|
"vocab:tools/deploy/shaker/strip-specialized-arrays.factor"
|
||||||
|
run-file
|
||||||
|
] when ;
|
||||||
|
|
||||||
: strip-word-names ( words -- )
|
: strip-word-names ( words -- )
|
||||||
"Stripping word names" show
|
"Stripping word names" show
|
||||||
[ f >>name f >>vocabulary drop ] each ;
|
[ f >>name f >>vocabulary drop ] each ;
|
||||||
|
@ -180,6 +187,8 @@ IN: tools.deploy.shaker
|
||||||
"transform-n"
|
"transform-n"
|
||||||
"transform-quot"
|
"transform-quot"
|
||||||
"type"
|
"type"
|
||||||
|
"typed-def"
|
||||||
|
"typed-word"
|
||||||
"writer"
|
"writer"
|
||||||
"writing"
|
"writing"
|
||||||
} %
|
} %
|
||||||
|
@ -503,6 +512,7 @@ SYMBOL: deploy-vocab
|
||||||
strip-call
|
strip-call
|
||||||
strip-cocoa
|
strip-cocoa
|
||||||
strip-debugger
|
strip-debugger
|
||||||
|
strip-specialized-arrays
|
||||||
compute-next-methods
|
compute-next-methods
|
||||||
strip-init-hooks
|
strip-init-hooks
|
||||||
add-command-line-hook
|
add-command-line-hook
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
IN: specialized-arrays
|
||||||
|
|
||||||
|
ERROR: cannot-define-array-in-deployed-app type ;
|
||||||
|
|
||||||
|
: define-array-vocab ( type -- ) cannot-define-array-in-deployed-app ;
|
|
@ -21,9 +21,9 @@ HOOK: init-stdio io-backend ( -- )
|
||||||
|
|
||||||
HOOK: io-multiplex io-backend ( us -- )
|
HOOK: io-multiplex io-backend ( us -- )
|
||||||
|
|
||||||
HOOK: normalize-directory io-backend ( str -- newstr )
|
HOOK: normalize-directory io-backend ( path -- path' )
|
||||||
|
|
||||||
HOOK: normalize-path io-backend ( str -- newstr )
|
HOOK: normalize-path io-backend ( path -- path' )
|
||||||
|
|
||||||
M: object normalize-directory normalize-path ;
|
M: object normalize-directory normalize-path ;
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ HELP: pathname
|
||||||
{ $class-description "Class of path name objects. Path name objects can be created by calling " { $link <pathname> } "." } ;
|
{ $class-description "Class of path name objects. Path name objects can be created by calling " { $link <pathname> } "." } ;
|
||||||
|
|
||||||
HELP: normalize-path
|
HELP: normalize-path
|
||||||
{ $values { "string" "a pathname string" } { "string'" "a new pathname string" } }
|
{ $values { "path" "a pathname string" } { "path'" "a new pathname string" } }
|
||||||
{ $description "Prepends the " { $link current-directory } " to the pathname, resolves a " { $snippet "resource:" } " or " { $snippet "voacb:" } " prefix, if present, and performs any platform-specific pathname normalization." }
|
{ $description "Prepends the " { $link current-directory } " to the pathname, resolves a " { $snippet "resource:" } " or " { $snippet "voacb:" } " prefix, if present, and performs any platform-specific pathname normalization." }
|
||||||
{ $notes "High-level words, such as " { $link <file-reader> } " and " { $link delete-file } " call this word for you. It only needs to be called directly when passing pathnames to C functions or external processes. This is because Factor does not use the operating system's notion of a current directory, and instead maintains its own dynamically-scoped " { $link current-directory } " variable." }
|
{ $notes "High-level words, such as " { $link <file-reader> } " and " { $link delete-file } " call this word for you. It only needs to be called directly when passing pathnames to C functions or external processes. This is because Factor does not use the operating system's notion of a current directory, and instead maintains its own dynamically-scoped " { $link current-directory } " variable." }
|
||||||
{ $notes "On Windows NT platforms, this word does prepends the Unicode path prefix." }
|
{ $notes "On Windows NT platforms, this word does prepends the Unicode path prefix." }
|
||||||
|
|
|
@ -371,7 +371,7 @@ HELP: POSTPONE:
|
||||||
HELP: :
|
HELP: :
|
||||||
{ $syntax ": word ( stack -- effect ) definition... ;" }
|
{ $syntax ": word ( stack -- effect ) definition... ;" }
|
||||||
{ $values { "word" "a new word to define" } { "definition" "a word definition" } }
|
{ $values { "word" "a new word to define" } { "definition" "a word definition" } }
|
||||||
{ $description "Defines a word with the given stack effect in the current vocabulary. The stack effect is optional for words which only push literals on the stack." }
|
{ $description "Defines a word with the given stack effect in the current vocabulary." }
|
||||||
{ $examples { $code ": ask-name ( -- name )\n \"What is your name? \" write readln ;\n: greet ( name -- )\n \"Greetings, \" write print ;\n: friend ( -- )\n ask-name greet ;" } } ;
|
{ $examples { $code ": ask-name ( -- name )\n \"What is your name? \" write readln ;\n: greet ( name -- )\n \"Greetings, \" write print ;\n: friend ( -- )\n ask-name greet ;" } } ;
|
||||||
|
|
||||||
{ POSTPONE: : POSTPONE: ; define } related-words
|
{ POSTPONE: : POSTPONE: ; define } related-words
|
||||||
|
|
|
@ -35,12 +35,9 @@ PRIVATE>
|
||||||
dup dim>> second iota [ draw-vertex-buffer-row ] with each
|
dup dim>> second iota [ draw-vertex-buffer-row ] with each
|
||||||
] with-gl-buffer ;
|
] with-gl-buffer ;
|
||||||
|
|
||||||
USE: tools.time
|
|
||||||
: <grid-mesh> ( dim -- grid-mesh )
|
: <grid-mesh> ( dim -- grid-mesh )
|
||||||
[
|
|
||||||
[ ] [ vertex-array >vertex-buffer ] [ first 1 + 2 * ] tri
|
[ ] [ vertex-array >vertex-buffer ] [ first 1 + 2 * ] tri
|
||||||
grid-mesh boa
|
grid-mesh boa ;
|
||||||
] time ;
|
|
||||||
|
|
||||||
M: grid-mesh dispose
|
M: grid-mesh dispose
|
||||||
[ [ delete-gl-buffer ] when* f ] change-buffer
|
[ [ delete-gl-buffer ] when* f ] change-buffer
|
||||||
|
|
|
@ -9,11 +9,11 @@ IN: random.cmwc
|
||||||
|
|
||||||
TUPLE: cmwc
|
TUPLE: cmwc
|
||||||
{ Q uint-array }
|
{ Q uint-array }
|
||||||
{ a fixnum }
|
{ a integer }
|
||||||
{ b fixnum }
|
{ b integer }
|
||||||
{ c fixnum }
|
{ c integer }
|
||||||
{ i fixnum }
|
{ i integer }
|
||||||
{ r fixnum }
|
{ r integer }
|
||||||
{ mod fixnum } ;
|
{ mod fixnum } ;
|
||||||
|
|
||||||
TUPLE: cmwc-seed { Q uint-array read-only } { c read-only } ;
|
TUPLE: cmwc-seed { Q uint-array read-only } { c read-only } ;
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
USING: tools.deploy.config ;
|
USING: tools.deploy.config ;
|
||||||
H{
|
H{
|
||||||
{ deploy-ui? t }
|
|
||||||
{ deploy-reflection 1 }
|
|
||||||
{ deploy-unicode? f }
|
|
||||||
{ deploy-math? t }
|
|
||||||
{ deploy-io 2 }
|
|
||||||
{ deploy-c-types? f }
|
|
||||||
{ deploy-name "Terrain" }
|
{ deploy-name "Terrain" }
|
||||||
{ deploy-word-props? f }
|
{ deploy-ui? t }
|
||||||
{ deploy-word-defs? f }
|
{ deploy-c-types? f }
|
||||||
|
{ deploy-unicode? f }
|
||||||
|
{ deploy-io 2 }
|
||||||
|
{ deploy-reflection 2 }
|
||||||
{ "stop-after-last-window?" t }
|
{ "stop-after-last-window?" t }
|
||||||
|
{ deploy-word-props? f }
|
||||||
|
{ deploy-math? t }
|
||||||
{ deploy-threads? t }
|
{ deploy-threads? t }
|
||||||
|
{ deploy-word-defs? f }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
USING: accessors alien.data.map arrays byte-arrays combinators
|
USING: accessors alien.data.map arrays byte-arrays combinators
|
||||||
combinators.smart fry grouping images kernel math
|
combinators.smart fry grouping images kernel math
|
||||||
math.matrices.simd math.order math.vectors noise random
|
math.matrices.simd math.order math.vectors noise random
|
||||||
sequences math.vectors.simd ;
|
sequences math.vectors.simd typed ;
|
||||||
FROM: alien.c-types => float uchar ;
|
FROM: alien.c-types => float uchar ;
|
||||||
SIMDS: float uchar ;
|
SIMDS: float uchar ;
|
||||||
IN: terrain.generation
|
IN: terrain.generation
|
||||||
|
|
||||||
CONSTANT: terrain-segment-size { 512 512 }
|
CONSTANT: terrain-segment-size { 512 512 }
|
||||||
CONSTANT: terrain-segment-size-vector { 512.0 512.0 1.0 1.0 }
|
CONSTANT: terrain-segment-size-vector float-4{ 512.0 512.0 1.0 1.0 }
|
||||||
CONSTANT: terrain-big-noise-scale float-4{ 0.002 0.002 0.002 0.002 }
|
CONSTANT: terrain-big-noise-scale float-4{ 0.002 0.002 0.002 0.002 }
|
||||||
CONSTANT: terrain-small-noise-scale float-4{ 0.05 0.05 0.05 0.05 }
|
CONSTANT: terrain-small-noise-scale float-4{ 0.05 0.05 0.05 0.05 }
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ TUPLE: segment image ;
|
||||||
ubyte-components >>component-type
|
ubyte-components >>component-type
|
||||||
terrain-segment-size >>dim ;
|
terrain-segment-size >>dim ;
|
||||||
|
|
||||||
: terrain-segment ( terrain at -- image )
|
TYPED: terrain-segment ( terrain: terrain at: float-4 -- image )
|
||||||
{
|
{
|
||||||
[ big-noise-segment ]
|
[ big-noise-segment ]
|
||||||
[ small-noise-segment ]
|
[ small-noise-segment ]
|
||||||
|
|
Loading…
Reference in New Issue