remove unnecessary memory>structs from extra/ too
parent
6d4724a095
commit
8628b60327
|
@ -512,9 +512,9 @@ FUNCTION: void cpArbiterIgnore ( cpArbiter* arb ) ;
|
||||||
|
|
||||||
TYPED: cpArbiterGetShapes ( arb: cpArbiter -- a: cpShape b: cpShape )
|
TYPED: cpArbiterGetShapes ( arb: cpArbiter -- a: cpShape b: cpShape )
|
||||||
dup swappedColl>> 0 = [
|
dup swappedColl>> 0 = [
|
||||||
[ a>> cpShape memory>struct ] [ b>> cpShape memory>struct ] bi
|
[ a>> ] [ b>> ] bi
|
||||||
] [
|
] [
|
||||||
[ b>> cpShape memory>struct ] [ a>> cpShape memory>struct ] bi
|
[ b>> ] [ a>> ] bi
|
||||||
] if ; inline
|
] if ; inline
|
||||||
|
|
||||||
TYPED: cpArbiterIsFirstContact ( arb: cpArbiter -- ? )
|
TYPED: cpArbiterIsFirstContact ( arb: cpArbiter -- ? )
|
||||||
|
|
|
@ -50,9 +50,9 @@ CONSTANT: image-bitmap B{
|
||||||
x bitnot 7 bitand neg shift 1 bitand 1 = ;
|
x bitnot 7 bitand neg shift 1 bitand 1 = ;
|
||||||
|
|
||||||
:: make-ball ( x y -- shape )
|
:: make-ball ( x y -- shape )
|
||||||
cpBodyAlloc 1.0 NAN: 0 cpBodyInit cpBody memory>struct
|
cpBodyAlloc 1.0 NAN: 0 cpBodyInit
|
||||||
x y cpv >>p :> body
|
x y cpv >>p :> body
|
||||||
cpCircleShapeAlloc body 0.95 0 0 cpv cpCircleShapeInit cpCircleShape memory>struct
|
cpCircleShapeAlloc body 0.95 0 0 cpv cpCircleShapeInit
|
||||||
[ shape>> 0 >>e ] [ shape>> 0 >>u ] bi drop ;
|
[ shape>> 0 >>e ] [ shape>> 0 >>u ] bi drop ;
|
||||||
|
|
||||||
TUPLE: chipmunk-world < game-world
|
TUPLE: chipmunk-world < game-world
|
||||||
|
@ -76,7 +76,7 @@ M:: chipmunk-world draw-world* ( world -- )
|
||||||
3 glPointSize
|
3 glPointSize
|
||||||
0 0 0 glColor3f
|
0 0 0 glColor3f
|
||||||
GL_POINTS glBegin
|
GL_POINTS glBegin
|
||||||
space bodies>> cpArray memory>struct
|
space bodies>>
|
||||||
[ num>> ] [ arr>> swap <direct-void*-array> ] bi [
|
[ num>> ] [ arr>> swap <direct-void*-array> ] bi [
|
||||||
cpBody memory>struct p>> [ x>> ] [ y>> ] bi glVertex2f
|
cpBody memory>struct p>> [ x>> ] [ y>> ] bi glVertex2f
|
||||||
] each
|
] each
|
||||||
|
@ -85,7 +85,7 @@ M:: chipmunk-world draw-world* ( world -- )
|
||||||
2 glPointSize
|
2 glPointSize
|
||||||
1 0 0 glColor3f
|
1 0 0 glColor3f
|
||||||
GL_POINTS glBegin
|
GL_POINTS glBegin
|
||||||
space arbiters>> cpArray memory>struct
|
space arbiters>>
|
||||||
[ num>> ] [ arr>> swap <direct-void*-array> ] bi [
|
[ num>> ] [ arr>> swap <direct-void*-array> ] bi [
|
||||||
cpArbiter memory>struct
|
cpArbiter memory>struct
|
||||||
[ numContacts>> ] [ contacts>> swap <direct-cpContact-array> ] bi [
|
[ numContacts>> ] [ contacts>> swap <direct-cpContact-array> ] bi [
|
||||||
|
@ -97,7 +97,7 @@ M:: chipmunk-world draw-world* ( world -- )
|
||||||
M:: chipmunk-world begin-game-world ( world -- )
|
M:: chipmunk-world begin-game-world ( world -- )
|
||||||
cpInitChipmunk
|
cpInitChipmunk
|
||||||
|
|
||||||
cpSpaceAlloc cpSpaceInit cpSpace memory>struct :> space
|
cpSpaceAlloc cpSpaceInit :> space
|
||||||
|
|
||||||
world space >>space drop
|
world space >>space drop
|
||||||
space 2.0 10000 cpSpaceResizeActiveHash
|
space 2.0 10000 cpSpaceResizeActiveHash
|
||||||
|
@ -115,11 +115,11 @@ M:: chipmunk-world begin-game-world ( world -- )
|
||||||
] each
|
] each
|
||||||
] each
|
] each
|
||||||
|
|
||||||
space cpBodyAlloc NAN: 0 dup cpBodyInit cpSpaceAddBody cpBody memory>struct :> body
|
space cpBodyAlloc NAN: 0 dup cpBodyInit cpSpaceAddBody :> body
|
||||||
body -1000 -10 cpv >>p drop
|
body -1000 -10 cpv >>p drop
|
||||||
body 400 0 cpv >>v drop
|
body 400 0 cpv >>v drop
|
||||||
|
|
||||||
space cpCircleShapeAlloc body 8 0 0 cpv cpCircleShapeInit cpSpaceAddShape cpCircleShape memory>struct :> shape
|
space cpCircleShapeAlloc body 8 0 0 cpv cpCircleShapeInit cpSpaceAddShape :> shape
|
||||||
shape
|
shape
|
||||||
[ shape>> 0 >>e drop ]
|
[ shape>> 0 >>e drop ]
|
||||||
[ shape>> 0 >>u drop ] bi ;
|
[ shape>> 0 >>u drop ] bi ;
|
||||||
|
|
Loading…
Reference in New Issue