Added some of the changes for x86_64 support from 9b44fc26

  * Thanks to @panreyes for proposing them! I will work on the rest
    to try to implement them ASAP
parent 2daf2ed6
......@@ -3,3 +3,4 @@
......@@ -46,7 +46,7 @@
* Helper function preparing params
static bgdata *prep(int *params) {
static bgdata *prep(intptr_t *params) {
bgdata *t = (bgdata *)malloc(sizeof(bgdata));
t->file = strdup((char *)string_get(params[0]));
t->id = (int *)params[1];
......@@ -71,7 +71,7 @@ int bgDoLoad(void *d) {
/* --------------------------------------------------------------------------- */
int bgload(int (*fn)(), int *params) {
int bgload(int (*fn)(), intptr_t *params) {
bgdata *t = prep(params);
t->fn = fn;
......@@ -39,7 +39,7 @@ typedef struct {
/* --------------------------------------------------------------------------- */
extern int bgload(int (*fn)(), int *params);
extern int bgload(int (*fn)(), intptr_t *params);
/* --------------------------------------------------------------------------- */
This diff is collapsed.
......@@ -14,49 +14,49 @@
#include "mod_map.h"
// int addConstr(cpBody *bod1, cpBody *bod2,cpConstraint * cons);
int modaddDampedSpring(INSTANCE *my, int *params);
int modaddPinJoint(INSTANCE *my, int *params);
int modaddPivotJoint2(INSTANCE *my, int *params);
int modaddSlideJoint(INSTANCE *my, int *params);
int modaddGrooveJoint(INSTANCE *my, int *params);
int modaddSimpleMotor(INSTANCE *my, int *params);
int modaddRatchetJoint(INSTANCE *my, int *params);
int modaddRotaryLimitJoint(INSTANCE *my, int *params);
int modaddGearJoint(INSTANCE *my, int *params);
int modaddDampedRotarySpring(INSTANCE *my, int *params);
int modaddPivotJoint(INSTANCE *my, int *params);
int modsetPinJointProperties(INSTANCE *my, int *params);
int modsetSlideJointProperties(INSTANCE *my, int *params);
int modsetPivotJointProperties(INSTANCE *my, int *params);
int modsetGrooveJointProperties(INSTANCE *my, int *params);
int modsetDampedSpringProperties(INSTANCE *my, int *params);
int modsetDampedRotarySpringProperties(INSTANCE *my, int *params);
int modsetRotaryLimitJointProperties(INSTANCE *my, int *params);
int modsetRatchetJointProperties(INSTANCE *my, int *params);
int modsetGearJointProperties(INSTANCE *my, int *params);
int modsetSimpleMotorProperties(INSTANCE *my, int *params);
int modgetPinJointProperties(INSTANCE *my, int *params);
int modgetSlideJointProperties(INSTANCE *my, int *params);
int modgetPivotJointProperties(INSTANCE *my, int *params);
int modgetGrooveJointProperties(INSTANCE *my, int *params);
int modgetDampedSpringProperties(INSTANCE *my, int *params);
int modgetDampedRotarySpringProperties(INSTANCE *my, int *params);
int modgetRotaryLimitJointProperties(INSTANCE *my, int *params);
int modgetRatchetJointProperties(INSTANCE *my, int *params);
int modgetGearJointProperties(INSTANCE *my, int *params);
int modgetSimpleMotorProperties(INSTANCE *my, int *params);
int modcpConstraintGetImpulse(INSTANCE *my, int *params);
int modDefcpConstraint(INSTANCE *my, int *params);
int modGetcpConstraint(INSTANCE *my, int *params);
int modcpConstraintSetPostSolveFunc(INSTANCE *my, int *params);
int modcpConstraintSetPreSolveFunc(INSTANCE *my, int *params);
int modGetFathetA(INSTANCE *my, int *params);
int modGetFathetB(INSTANCE *my, int *params);
int modremoveConstraint(INSTANCE *my, int *params);
int modaddDampedSpring(INSTANCE *my, intptr_t *params);
int modaddPinJoint(INSTANCE *my, intptr_t *params);
int modaddPivotJoint2(INSTANCE *my, intptr_t *params);
int modaddSlideJoint(INSTANCE *my, intptr_t *params);
int modaddGrooveJoint(INSTANCE *my, intptr_t *params);
int modaddSimpleMotor(INSTANCE *my, intptr_t *params);
int modaddRatchetJoint(INSTANCE *my, intptr_t *params);
int modaddRotaryLimitJoint(INSTANCE *my, intptr_t *params);
int modaddGearJoint(INSTANCE *my, intptr_t *params);
int modaddDampedRotarySpring(INSTANCE *my, intptr_t *params);
int modaddPivotJoint(INSTANCE *my, intptr_t *params);
int modsetPinJointProperties(INSTANCE *my, intptr_t *params);
int modsetSlideJointProperties(INSTANCE *my, intptr_t *params);
int modsetPivotJointProperties(INSTANCE *my, intptr_t *params);
int modsetGrooveJointProperties(INSTANCE *my, intptr_t *params);
int modsetDampedSpringProperties(INSTANCE *my, intptr_t *params);
int modsetDampedRotarySpringProperties(INSTANCE *my, intptr_t *params);
int modsetRotaryLimitJointProperties(INSTANCE *my, intptr_t *params);
int modsetRatchetJointProperties(INSTANCE *my, intptr_t *params);
int modsetGearJointProperties(INSTANCE *my, intptr_t *params);
int modsetSimpleMotorProperties(INSTANCE *my, intptr_t *params);
int modgetPinJointProperties(INSTANCE *my, intptr_t *params);
int modgetSlideJointProperties(INSTANCE *my, intptr_t *params);
int modgetPivotJointProperties(INSTANCE *my, intptr_t *params);
int modgetGrooveJointProperties(INSTANCE *my, intptr_t *params);
int modgetDampedSpringProperties(INSTANCE *my, intptr_t *params);
int modgetDampedRotarySpringProperties(INSTANCE *my, intptr_t *params);
int modgetRotaryLimitJointProperties(INSTANCE *my, intptr_t *params);
int modgetRatchetJointProperties(INSTANCE *my, intptr_t *params);
int modgetGearJointProperties(INSTANCE *my, intptr_t *params);
int modgetSimpleMotorProperties(INSTANCE *my, intptr_t *params);
int modcpConstraintGetImpulse(INSTANCE *my, intptr_t *params);
int modDefcpConstraint(INSTANCE *my, intptr_t *params);
int modGetcpConstraint(INSTANCE *my, intptr_t *params);
int modcpConstraintSetPostSolveFunc(INSTANCE *my, intptr_t *params);
int modcpConstraintSetPreSolveFunc(INSTANCE *my, intptr_t *params);
int modGetFathetA(INSTANCE *my, intptr_t *params);
int modGetFathetB(INSTANCE *my, intptr_t *params);
int modremoveConstraint(INSTANCE *my, intptr_t *params);
void eliminaConstraint(void *par);
......@@ -9,17 +9,17 @@
extern cpSpace *modChipmunk_cpEspacio;
extern DataPointer modChipmunk_ListaCuerpos;
int modgetBody(INSTANCE *my, int *params) {
int modgetBody(INSTANCE *my, intptr_t *params) {
return (int)modChipmunk_cpEspacio->staticBody;
int modcpBodyLocal2World(INSTANCE *my, int *params) {
int modcpBodyLocal2World(INSTANCE *my, intptr_t *params) {
cpVect *ind = params[2];
*ind = cpBodyLocal2World((cpBody *)params[0], *(cpVect *)params[1]);
return 0;
int modDefcpBody(INSTANCE *my, int *params) {
int modDefcpBody(INSTANCE *my, intptr_t *params) {
cpVect *flo2;
int sel = params[1];
float flo1;
......@@ -79,7 +79,7 @@ int modDefcpBody(INSTANCE *my, int *params) {
return 0;
int modGetEcpBody(INSTANCE *my, int *params) {
int modGetEcpBody(INSTANCE *my, intptr_t *params) {
int sel = params[1];
cpBody *espacioM = (cpBody *)params[0];
cpVect cp;
......@@ -146,88 +146,88 @@ int modGetEcpBody(INSTANCE *my, int *params) {
return 0;
int modcpBodySetMass(INSTANCE *my, int *params) {
int modcpBodySetMass(INSTANCE *my, intptr_t *params) {
cpBodySetMass((cpBody *)params[0], *((float *)&params[1]));
return 0;
int modcpBodySetMoment(INSTANCE *my, int *params) {
int modcpBodySetMoment(INSTANCE *my, intptr_t *params) {
cpBodySetMoment((cpBody *)params[0], *((float *)&params[1]));
return 0;
int modcpBodySetAngle(INSTANCE *my, int *params) {
int modcpBodySetAngle(INSTANCE *my, intptr_t *params) {
cpBodySetAngle((cpBody *)params[0], *((float *)&params[1]));
return 0;
int modcpBodyUpdatePosition(INSTANCE *my, int *params) {
int modcpBodyUpdatePosition(INSTANCE *my, intptr_t *params) {
cpBodyUpdatePosition((cpBody *)params[0], *((float *)&params[1]));
return 0;
int modcpBodyResetForces(INSTANCE *my, int *params) {
int modcpBodyResetForces(INSTANCE *my, intptr_t *params) {
cpBodyResetForces((cpBody *)params[0]);
return 0;
int modcpBodyIsSleeping(INSTANCE *my, int *params) {
int modcpBodyIsSleeping(INSTANCE *my, intptr_t *params) {
return cpBodyIsSleeping((cpBody *)params[0]);
int modcpBodySleep(INSTANCE *my, int *params) {
int modcpBodySleep(INSTANCE *my, intptr_t *params) {
cpBodySleep((cpBody *)params[0]);
return 0;
int modcpBodyActivate(INSTANCE *my, int *params) {
int modcpBodyActivate(INSTANCE *my, intptr_t *params) {
cpBodyActivate((cpBody *)params[0]);
return 0;
int modcpBodyIsStatic(INSTANCE *my, int *params) {
int modcpBodyIsStatic(INSTANCE *my, intptr_t *params) {
int a = cpBodyIsStatic((cpBody *)params[0]);
return a;
int modcpBodyIsRogue(INSTANCE *my, int *params) {
int modcpBodyIsRogue(INSTANCE *my, intptr_t *params) {
int a = cpBodyIsRogue((cpBody *)params[0]);
return a;
int modcpBodySleepWithGroup(INSTANCE *my, int *params) {
int modcpBodySleepWithGroup(INSTANCE *my, intptr_t *params) {
cpBodySleepWithGroup((cpBody *)params[0], (cpBody *)params[1]);
return 0;
int modcpBodyApplyForce(INSTANCE *my, int *params) {
int modcpBodyApplyForce(INSTANCE *my, intptr_t *params) {
cpBodyApplyForce((cpBody *)params[0], *(cpVect *)params[1], *(cpVect *)params[2]);
return 0;
int modcpBodyApplyImpulse(INSTANCE *my, int *params) {
int modcpBodyApplyImpulse(INSTANCE *my, intptr_t *params) {
cpBodyApplyImpulse((cpBody *)params[0], *(cpVect *)params[1], *(cpVect *)params[2]);
return 0;
int modcpBodyWorld2Local(INSTANCE *my, int *params) {
int modcpBodyWorld2Local(INSTANCE *my, intptr_t *params) {
cpVect *vc = params[2];
*vc = cpBodyWorld2Local((cpBody *)params[0], *(cpVect *)params[1]);
return 0;
int modcpBodySlew(INSTANCE *my, int *params) {
int modcpBodySlew(INSTANCE *my, intptr_t *params) {
cpBodySlew((cpBody *)params[0], *(cpVect *)params[1], *((float *)&params[2]));
return 0;
int modcpBodyUpdateVelocity(INSTANCE *my, int *params) {
int modcpBodyUpdateVelocity(INSTANCE *my, intptr_t *params) {
cpBodyUpdateVelocity((cpBody *)params[0], *(cpVect *)params[1], *(float *)&params[2],
*(float *)&params[3]);
return 0;
int modActivateProcessTouchingIt(INSTANCE *my, int *params) {
int modActivateProcessTouchingIt(INSTANCE *my, intptr_t *params) {
(cpShape *)LOCDWORD(mod_chipmunk, my, LOC_SHAPE));
return 0;
......@@ -264,7 +264,7 @@ void addListaProcesos(INSTANCE *ins) {
modChipmunk_ListaCuerpos->sig = dataP;
int modaddCircleShape(INSTANCE *my, int *params) {
int modaddCircleShape(INSTANCE *my, intptr_t *params) {
if (LOCDWORD(mod_chipmunk, my, LOC_SHAPETYPE) == TYPE_NONE) {
} else {
......@@ -310,7 +310,7 @@ int modaddCircleShape(INSTANCE *my, int *params) {
return (int)sha;
int modaddSegmentShape(INSTANCE *my, int *params) {
int modaddSegmentShape(INSTANCE *my, intptr_t *params) {
if (LOCDWORD(mod_chipmunk, my, LOC_SHAPETYPE) == TYPE_NONE) {
} else {
......@@ -355,7 +355,7 @@ int modaddSegmentShape(INSTANCE *my, int *params) {
return (int)sha;
int modaddSegmentShapeTo(INSTANCE *my, int *params) {
int modaddSegmentShapeTo(INSTANCE *my, intptr_t *params) {
my = instance_get(params[5]);
if (LOCDWORD(mod_chipmunk, my, LOC_SHAPETYPE) == TYPE_NONE) {
......@@ -401,7 +401,7 @@ int modaddSegmentShapeTo(INSTANCE *my, int *params) {
return (int)sha;
int modaddPolyShape(INSTANCE *my, int *params) {
int modaddPolyShape(INSTANCE *my, intptr_t *params) {
if (LOCDWORD(mod_chipmunk, my, LOC_SHAPETYPE) == TYPE_NONE) {
} else {
......@@ -542,7 +542,7 @@ int calculaCuerpoConvexo(GRAPH *map, modChipmunkStruct_Point *r) {
return cantCH;
int modcpCalculaConvexHull(INSTANCE *my, int *params) {
int modcpCalculaConvexHull(INSTANCE *my, intptr_t *params) {
GRAPH *map = bitmap_get(params[0], params[1]);
modChipmunkStruct_Point *r = params[2];
// printf("%p\n",r); fflush(stdout);
......@@ -15,34 +15,34 @@
#include "Arreglos.h"
#include "LL.h"
int modgetBody(INSTANCE *my, int *params);
int modcpBodyLocal2World(INSTANCE *my, int *params);
int modDefcpBody(INSTANCE *my, int *params);
int modGetEcpBody(INSTANCE *my, int *params);
int modcpBodySetMass(INSTANCE *my, int *params);
int modcpBodySetMoment(INSTANCE *my, int *params);
int modcpBodySetAngle(INSTANCE *my, int *params);
int modcpBodyUpdatePosition(INSTANCE *my, int *params);
int modcpBodyResetForces(INSTANCE *my, int *params);
int modcpBodyIsSleeping(INSTANCE *my, int *params);
int modcpBodySleep(INSTANCE *my, int *params);
int modcpBodyActivate(INSTANCE *my, int *params);
int modcpBodyIsStatic(INSTANCE *my, int *params);
int modcpBodyIsRogue(INSTANCE *my, int *params);
int modcpBodySleepWithGroup(INSTANCE *my, int *params);
int modcpBodyApplyForce(INSTANCE *my, int *params);
int modcpBodyApplyImpulse(INSTANCE *my, int *params);
int modcpBodyWorld2Local(INSTANCE *my, int *params);
int modcpBodySlew(INSTANCE *my, int *params);
int modcpBodyUpdateVelocity(INSTANCE *my, int *params);
int modActivateProcessTouchingIt(INSTANCE *my, int *params);
int modgetBody(INSTANCE *my, intptr_t *params);
int modcpBodyLocal2World(INSTANCE *my, intptr_t *params);
int modDefcpBody(INSTANCE *my, intptr_t *params);
int modGetEcpBody(INSTANCE *my, intptr_t *params);
int modcpBodySetMass(INSTANCE *my, intptr_t *params);
int modcpBodySetMoment(INSTANCE *my, intptr_t *params);
int modcpBodySetAngle(INSTANCE *my, intptr_t *params);
int modcpBodyUpdatePosition(INSTANCE *my, intptr_t *params);
int modcpBodyResetForces(INSTANCE *my, intptr_t *params);
int modcpBodyIsSleeping(INSTANCE *my, intptr_t *params);
int modcpBodySleep(INSTANCE *my, intptr_t *params);
int modcpBodyActivate(INSTANCE *my, intptr_t *params);
int modcpBodyIsStatic(INSTANCE *my, intptr_t *params);
int modcpBodyIsRogue(INSTANCE *my, intptr_t *params);
int modcpBodySleepWithGroup(INSTANCE *my, intptr_t *params);
int modcpBodyApplyForce(INSTANCE *my, intptr_t *params);
int modcpBodyApplyImpulse(INSTANCE *my, intptr_t *params);
int modcpBodyWorld2Local(INSTANCE *my, intptr_t *params);
int modcpBodySlew(INSTANCE *my, intptr_t *params);
int modcpBodyUpdateVelocity(INSTANCE *my, intptr_t *params);
int modActivateProcessTouchingIt(INSTANCE *my, intptr_t *params);
void addListaProcesos(INSTANCE *ins);
int modaddCircleShape(INSTANCE *my, int *params);
int modaddSegmentShape(INSTANCE *my, int *params);
int modaddPolyShape(INSTANCE *my, int *params);
int modaddCircleShape(INSTANCE *my, intptr_t *params);
int modaddSegmentShape(INSTANCE *my, intptr_t *params);
int modaddPolyShape(INSTANCE *my, intptr_t *params);
int creaPoly(int *params, cpBody *bod);
int modaddSegmentShapeTo(INSTANCE *my, int *params);
int modaddSegmentShapeTo(INSTANCE *my, intptr_t *params);
#define ajustaTam LOCDWORD(mod_chipmunk, my, LOC_SIZE) / 100.0
int creaBodyAndShapeAutomat(INSTANCE *my);
int modcpCalculaConvexHull(INSTANCE *my, int *params);
int modcpCalculaConvexHull(INSTANCE *my, intptr_t *params);
......@@ -2,32 +2,32 @@
extern cpSpace *modChipmunk_cpEspacio;
int modcpSpaceGetCurrentTimeStep(INSTANCE *my, int *params) {
int modcpSpaceGetCurrentTimeStep(INSTANCE *my, intptr_t *params) {
float r = cpSpaceGetCurrentTimeStep(modChipmunk_cpEspacio);
return *(int *)&r;
int modGetStaticBody(INSTANCE *my, int *params) {
int modGetStaticBody(INSTANCE *my, intptr_t *params) {
return modChipmunk_cpEspacio->staticBody;
int modcpSpaceActivateShapesTouchingShape(INSTANCE *my, int *params) {
int modcpSpaceActivateShapesTouchingShape(INSTANCE *my, intptr_t *params) {
cpSpaceActivateShapesTouchingShape(modChipmunk_cpEspacio, (cpShape *)params[0]);
return 0;
int modcpSpaceResizeStaticHash(INSTANCE *my, int *params) {
int modcpSpaceResizeStaticHash(INSTANCE *my, intptr_t *params) {
// cpHashResizeHash(modChipmunk_cpEspacio,*(( float * ) &params[0]),params[1]);
printf("Función en desuso\n");
return 0;
int modcpSpaceResizeActiveHash(INSTANCE *my, int *params) {
int modcpSpaceResizeActiveHash(INSTANCE *my, intptr_t *params) {
// cpSpaceResizeActiveHash(modChipmunk_cpEspacio,*(( float * ) &params[0]),params[1]);
printf("Función en desuso\n");
return 0;
int modcpSpaceUseSpatialHash(INSTANCE *my, int *params) {
int modcpSpaceUseSpatialHash(INSTANCE *my, intptr_t *params) {
cpSpaceUseSpatialHash(modChipmunk_cpEspacio, *(float *)&params[0], params[1]);
return 1;
......@@ -13,11 +13,11 @@
#include "librender.h"
#include "mod_map.h"
int modcpSpaceGetCurrentTimeStep(INSTANCE *my, int *params);
int modGetStaticBody(INSTANCE *my, int *params);
int modcpSpaceActivateShapesTouchingShape(INSTANCE *my, int *params);
int modcpSpaceResizeStaticHash(INSTANCE *my, int *params);
int modcpSpaceResizeActiveHash(INSTANCE *my, int *params);
int modcpSpaceUseSpatialHash(INSTANCE *my, int *params);
int modcpSpaceGetCurrentTimeStep(INSTANCE *my, intptr_t *params);
int modGetStaticBody(INSTANCE *my, intptr_t *params);
int modcpSpaceActivateShapesTouchingShape(INSTANCE *my, intptr_t *params);
int modcpSpaceResizeStaticHash(INSTANCE *my, intptr_t *params);
int modcpSpaceResizeActiveHash(INSTANCE *my, intptr_t *params);
int modcpSpaceUseSpatialHash(INSTANCE *my, intptr_t *params);
......@@ -76,7 +76,7 @@ void modChipmunkFalloHandler(int *params, Hands *h) {
int modcpSpaceAddCollisionHandler(INSTANCE *my, int *params) {
int modcpSpaceAddCollisionHandler(INSTANCE *my, intptr_t *params) {
modChipmunkStruct_param2d par = modChipmunkParam(params[0], params[1]);
if (LLbusca(modChipmunk_ListaHandlers, &par, compara)) {
printf("Se intentó crear un handler a (%d, %d), pero ya existe uno \n", params[0],
......@@ -172,7 +172,7 @@ int modcpSpaceAddCollisionHandler(INSTANCE *my, int *params) {
return 1;
int modcpSpaceRemoveCollisionHandler(INSTANCE *my, int *params) {
int modcpSpaceRemoveCollisionHandler(INSTANCE *my, intptr_t *params) {
// cpSpaceRemoveCollisionHandler(modChipmunk_cpEspacio, params[0], params[1],funcionElmHand);
modChipmunkStruct_param2d par = modChipmunkParam(params[0], params[1]);
LLelimina(modChipmunk_ListaHandlers, &par, compara, funcionElmHand, 1);
......@@ -225,7 +225,7 @@ void buscaABCol(void *ptr, void *data) {
int modcrearHandler(INSTANCE *my, int *params) {
int modcrearHandler(INSTANCE *my, intptr_t *params) {
modChipmunk_Crear = 1;
int par[2];
par[0] = params[0];
......@@ -250,7 +250,7 @@ int modcrearHandler(INSTANCE *my, int *params) {
return (int)col;
int modremoveHandler(INSTANCE *my, int *params) {
int modremoveHandler(INSTANCE *my, intptr_t *params) {
modChipmunkStruct_colHand *col = (modChipmunkStruct_colHand *)params[0];
cpSpaceRemoveCollisionHandler(modChipmunk_cpEspacio, col->a, col->b);
cpArrayDeleteObj(HandlerColisions, col);
......@@ -16,10 +16,10 @@
#include "LL.h"
int beginCall(cpArbiter *arb, struct cpSpace *space, void *data);
int modcpSpaceAddCollisionHandler(INSTANCE *my, int *params);
int modcpSpaceRemoveCollisionHandler(INSTANCE *my, int *params);
int modremoveHandler(INSTANCE *my, int *params);
int modcrearHandler(INSTANCE *my, int *params);
int modcpSpaceAddCollisionHandler(INSTANCE *my, intptr_t *params);
int modcpSpaceRemoveCollisionHandler(INSTANCE *my, intptr_t *params);
int modremoveHandler(INSTANCE *my, intptr_t *params);
int modcrearHandler(INSTANCE *my, intptr_t *params);
void recogeColisionHandler(cpArbiter *arb, cpSpace *space, void *dat);
void buscaABCol(void *ptr, void *data);
typedef struct {
......@@ -57,7 +57,7 @@ static inline int Metaball(int x, int y, int *xp, int *yp, int tam, float t, flo
return v > tr;
// encontrar minx y miny para el pintado...
int modChipmunkPintaAgua(INSTANCE *my, int *params) {
int modChipmunkPintaAgua(INSTANCE *my, intptr_t *params) {
GRAPH *map = bitmap_get(params[0], params[1]);
int anc = map->width;
int alt = map->height;
......@@ -109,7 +109,7 @@ int modChipmunkPintaAgua(INSTANCE *my, int *params) {
map->needs_texture_update = 1;
int modChipmunkMetaball(INSTANCE *my, int *params) {
int modChipmunkMetaball(INSTANCE *my, intptr_t *params) {
// printf("%d %d %d %p %d\n",params[0],params[1],params[2],params[3],params[4]); fflush(stdout);
float v = 0.0, a, b, t;
int z;
......@@ -126,7 +126,7 @@ int modChipmunkMetaball(INSTANCE *my, int *params) {
return v > (*(float *)&params[5]);
int modChipmunkSetEfector(INSTANCE *my, int *params) {
int modChipmunkSetEfector(INSTANCE *my, intptr_t *params) {
((DataPointer)((cpShape *)params[0])->body->data)->grupoEfector = params[1];
......@@ -244,7 +244,7 @@ int modChipmunkAgua(int *ids, int tam, float kNorm, float kNearNorm, float kRest
int modChipmunkEmulateAgua(INSTANCE *my, int *params) {
int modChipmunkEmulateAgua(INSTANCE *my, intptr_t *params) {
float kdt = *(float *)GLOADDR(mod_chipmunk, GLO_INTERVAL) /
(float)GLODWORD(mod_chipmunk, GLO_PHRESOLUTION);
WaterS *ws = params[0];
......@@ -11,8 +11,8 @@
#include "mod_map.h"
#include "globales.h"
#include "locales.h"
int modChipmunkPintaAgua(INSTANCE *my, int *params);
int modChipmunkMetaball(INSTANCE *my, int *params);
int modChipmunkSetEfector(INSTANCE *my, int *params);
int modChipmunkEmulateAgua(INSTANCE *my, int *params);
int modChipmunkPintaAgua(INSTANCE *my, intptr_t *params);
int modChipmunkMetaball(INSTANCE *my, intptr_t *params);
int modChipmunkSetEfector(INSTANCE *my, intptr_t *params);
int modChipmunkEmulateAgua(INSTANCE *my, intptr_t *params);
......@@ -14,87 +14,87 @@ typedef struct modChipmunkStruct_Data_Pointer {
int typeShape;
} * DataPointer;
int modArbiterGetNumContactPoints(INSTANCE *my, int *params) {
int modArbiterGetNumContactPoints(INSTANCE *my, intptr_t *params) {
return cpArbiterGetCount((cpArbiter *)params[0]);
int modArbiterIsFirstContact(INSTANCE *my, int *params) {
int modArbiterIsFirstContact(INSTANCE *my, intptr_t *params) {
return cpArbiterIsFirstContact((cpArbiter *)params[0]);
int modArbiterGetNormal(INSTANCE *my, int *params) {
int modArbiterGetNormal(INSTANCE *my, intptr_t *params) {
cpVect v = cpArbiterGetNormal((cpArbiter *)params[0], params[1]);
*(float *)params[2] = v.x;
*(float *)params[3] = v.y;
return 1;
int modArbiterGetPoint(INSTANCE *my, int *params) {
int modArbiterGetPoint(INSTANCE *my, intptr_t *params) {
cpVect v = cpArbiterGetPoint((cpArbiter *)params[0], params[1]);
*(float *)params[2] = v.x;
*(float *)params[3] = v.y;
return 1;
int modArbiterGetDepth(INSTANCE *my, int *params) {
int modArbiterGetDepth(INSTANCE *my, intptr_t *params) {
float f = cpArbiterGetDepth((cpArbiter *)params[0], params[1]);
return *(int *)&f;
int modArbiterTotalImpulseWithFriction(INSTANCE *my, int *params) {
int modArbiterTotalImpulseWithFriction(INSTANCE *my, intptr_t *params) {
cpVect v = cpArbiterTotalImpulseWithFriction((cpArbiter *)params[0]);
*(float *)params[1] = v.x;
*(float *)params[2] = v.y;
return 1;
int modArbiterTotalImpulse(INSTANCE *my, int *params) {
int modArbiterTotalImpulse(INSTANCE *my, intptr_t *params) {
cpVect v = cpArbiterTotalImpulse((cpArbiter *)params[0]);
*(float *)params[1] = v.x;
*(float *)params[2] = v.y;
return 1;
int modArbiterProcessA(INSTANCE *my, int *params) {
int modArbiterProcessA(INSTANCE *my, intptr_t *params) {
cpBody *b, *c;
cpArbiterGetBodies((cpArbiter *)params[0], &b, &c);
return ((DataPointer)b->data)->father;
int modArbiterProcessB(INSTANCE *my, int *params) {
int modArbiterProcessB(INSTANCE *my, intptr_t *params) {
cpBody *b, *c;
cpArbiterGetBodies((cpArbiter *)params[0], &b, &c);
return ((DataPointer)c->data)->father;
int modArbiterGetElasticity(INSTANCE *my, int *params) {
int modArbiterGetElasticity(INSTANCE *my, intptr_t *params) {
float f = cpArbiterGetElasticity((cpArbiter *)params[0]);
return *(int *)&f;
int modArbiterSetElasticity(INSTANCE *my, int *params) {
int modArbiterSetElasticity(INSTANCE *my, intptr_t *params) {
cpArbiterSetElasticity((cpArbiter *)params[0], *(float *)&params[1]);
return 1;
int modArbiterGetFriction(INSTANCE *my, int *params) {
int modArbiterGetFriction(INSTANCE *my, intptr_t *params) {
float f = cpArbiterGetFriction((cpArbiter *)params[0]);
return *(int *)&f;
int modArbiterSetFriction(INSTANCE *my, int *params) {
int modArbiterSetFriction(INSTANCE *my, intptr_t *params) {
cpArbiterSetFriction((cpArbiter *)params[0], *(float *)&params[1]);
return 1;
int modArbiterGetSurfaceVelocity(INSTANCE *my, int *params) {
int modArbiterGetSurfaceVelocity(INSTANCE *my, intptr_t *params) {
cpVect v = cpArbiterGetSurfaceVelocity((cpArbiter *)params[0]);
*(float *)params[1] = v.x;
*(float *)params[2] = v.y;
return 1;
int modArbiterSetSurfaceVelocity(INSTANCE *my, int *params) {