comparison trunk/chipmunkd/cpBody.d @ 28:4541ca17975b

use __gshared as chipmunk heavily relies on globals and D would otherwise make them TLS
author Extrawurst
date Mon, 13 Dec 2010 21:40:56 +0100
parents 4ceef5833c8c
children
comparison
equal deleted inserted replaced
27:b45f0b140d85 28:4541ca17975b
218 //// Apply a damped spring force between two bodies. 218 //// Apply a damped spring force between two bodies.
219 //// Warning: Large damping values can be unstable. Use a cpDampedSpring constraint for this instead. 219 //// Warning: Large damping values can be unstable. Use a cpDampedSpring constraint for this instead.
220 //void cpApplyDampedSpring(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat rlen, cpFloat k, cpFloat dmp, cpFloat dt); 220 //void cpApplyDampedSpring(cpBody *a, cpBody *b, cpVect anchr1, cpVect anchr2, cpFloat rlen, cpFloat k, cpFloat dmp, cpFloat dt);
221 221
222 // initialized in cpInitChipmunk() 222 // initialized in cpInitChipmunk()
223 cpBody cpStaticBodySingleton; 223 __gshared cpBody cpStaticBodySingleton;
224 224
225 cpBody* 225 cpBody*
226 cpBodyAlloc() 226 cpBodyAlloc()
227 { 227 {
228 return cast(cpBody *)cpmalloc(cpBody.sizeof); 228 return cast(cpBody *)cpmalloc(cpBody.sizeof);
229 } 229 }
230 230
231 cpBodyVelocityFunc cpBodyUpdateVelocityDefault = &cpBodyUpdateVelocity; 231 __gshared cpBodyVelocityFunc cpBodyUpdateVelocityDefault = &cpBodyUpdateVelocity;
232 cpBodyPositionFunc cpBodyUpdatePositionDefault = &cpBodyUpdatePosition; 232 __gshared cpBodyPositionFunc cpBodyUpdatePositionDefault = &cpBodyUpdatePosition;
233 233
234 cpBody* 234 cpBody*
235 cpBodyInit(cpBody *_body, cpFloat m, cpFloat i) 235 cpBodyInit(cpBody *_body, cpFloat m, cpFloat i)
236 { 236 {
237 _body.velocity_func = cpBodyUpdateVelocityDefault; 237 _body.velocity_func = cpBodyUpdateVelocityDefault;