From 8628b6032738dd5612805db6c26f1e8273a47d26 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Mon, 22 Feb 2010 12:34:38 -0800 Subject: [PATCH] remove unnecessary memory>structs from extra/ too --- extra/chipmunk/chipmunk.factor | 4 ++-- extra/chipmunk/demo/demo.factor | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/extra/chipmunk/chipmunk.factor b/extra/chipmunk/chipmunk.factor index c56e15e12e..a7cd5e0fd2 100644 --- a/extra/chipmunk/chipmunk.factor +++ b/extra/chipmunk/chipmunk.factor @@ -512,9 +512,9 @@ FUNCTION: void cpArbiterIgnore ( cpArbiter* arb ) ; TYPED: cpArbiterGetShapes ( arb: cpArbiter -- a: cpShape b: cpShape ) 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 TYPED: cpArbiterIsFirstContact ( arb: cpArbiter -- ? ) diff --git a/extra/chipmunk/demo/demo.factor b/extra/chipmunk/demo/demo.factor index 06f3c32dbe..38a8689bec 100644 --- a/extra/chipmunk/demo/demo.factor +++ b/extra/chipmunk/demo/demo.factor @@ -50,9 +50,9 @@ CONSTANT: image-bitmap B{ x bitnot 7 bitand neg shift 1 bitand 1 = ; :: 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 - 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 ; TUPLE: chipmunk-world < game-world @@ -76,7 +76,7 @@ M:: chipmunk-world draw-world* ( world -- ) 3 glPointSize 0 0 0 glColor3f GL_POINTS glBegin - space bodies>> cpArray memory>struct + space bodies>> [ num>> ] [ arr>> swap ] bi [ cpBody memory>struct p>> [ x>> ] [ y>> ] bi glVertex2f ] each @@ -85,7 +85,7 @@ M:: chipmunk-world draw-world* ( world -- ) 2 glPointSize 1 0 0 glColor3f GL_POINTS glBegin - space arbiters>> cpArray memory>struct + space arbiters>> [ num>> ] [ arr>> swap ] bi [ cpArbiter memory>struct [ numContacts>> ] [ contacts>> swap ] bi [ @@ -97,7 +97,7 @@ M:: chipmunk-world draw-world* ( world -- ) M:: chipmunk-world begin-game-world ( world -- ) cpInitChipmunk - cpSpaceAlloc cpSpaceInit cpSpace memory>struct :> space + cpSpaceAlloc cpSpaceInit :> space world space >>space drop space 2.0 10000 cpSpaceResizeActiveHash @@ -115,11 +115,11 @@ M:: chipmunk-world begin-game-world ( world -- ) ] 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 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>> 0 >>e drop ] [ shape>> 0 >>u drop ] bi ;