terrain: make it deploy

db4
Slava Pestov 2009-10-16 23:43:44 -05:00
parent fae924ece3
commit 5328af8090
3 changed files with 12 additions and 15 deletions

View File

@ -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

View File

@ -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 }
} }

View File

@ -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 ]