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 @@
*.a
*.dcb
.idea
/3rdparty/steamworks
......@@ -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.
#ifndef CONSTRAINTS_H
#define CONSTRAINTS_H
#include <stdlib.h>
#include <math.h>
#include "chipmunk.h"
#include "pxtdl.h"
#include "pxtrtm.h"
#include "xstrings.h"
#include "dlvaracc.h"
#include "libdraw.h"
#include "librender.h"
#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);
void eliminaConstraint(void *par);
#endif
#ifndef CONSTRAINTS_H
#define CONSTRAINTS_H
#include <stdlib.h>
#include <math.h>
#include "chipmunk.h"
#include "pxtdl.h"
#include "pxtrtm.h"
#include "xstrings.h"
#include "dlvaracc.h"
#include "libdraw.h"
#include "librender.h"
#include "mod_map.h"
// int addConstr(cpBody *bod1, cpBody *bod2,cpConstraint * cons);
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);
#endif
This diff is collapsed.
#ifndef CUERPO_H
#define CUERPO_H
#include <stdlib.h>
#include <math.h>
#include "chipmunk.h"
#include "pxtdl.h"
#include "pxtrtm.h"
#include "xstrings.h"
#include "dlvaracc.h"
#include "libdraw.h"
#include "librender.h"
#include "mod_map.h"
#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);
void addListaProcesos(INSTANCE *ins);
int modaddCircleShape(INSTANCE *my, int *params);
int modaddSegmentShape(INSTANCE *my, int *params);
int modaddPolyShape(INSTANCE *my, int *params);
int creaPoly(int *params, cpBody *bod);
int modaddSegmentShapeTo(INSTANCE *my, int *params);
#define ajustaTam LOCDWORD(mod_chipmunk, my, LOC_SIZE) / 100.0
int creaBodyAndShapeAutomat(INSTANCE *my);
int modcpCalculaConvexHull(INSTANCE *my, int *params);
#endif
#ifndef CUERPO_H
#define CUERPO_H
#include <stdlib.h>
#include <math.h>
#include "chipmunk.h"
#include "pxtdl.h"
#include "pxtrtm.h"
#include "xstrings.h"
#include "dlvaracc.h"
#include "libdraw.h"
#include "librender.h"
#include "mod_map.h"
#include "Arreglos.h"
#include "LL.h"
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, 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, intptr_t *params);
#define ajustaTam LOCDWORD(mod_chipmunk, my, LOC_SIZE) / 100.0
int creaBodyAndShapeAutomat(INSTANCE *my);
int modcpCalculaConvexHull(INSTANCE *my, intptr_t *params);
#endif
#include "Espacio.h"
extern cpSpace *modChipmunk_cpEspacio;
int modcpSpaceGetCurrentTimeStep(INSTANCE *my, int *params) {
float r = cpSpaceGetCurrentTimeStep(modChipmunk_cpEspacio);
return *(int *)&r;
}
int modGetStaticBody(INSTANCE *my, int *params) {
return modChipmunk_cpEspacio->staticBody;
}
int modcpSpaceActivateShapesTouchingShape(INSTANCE *my, int *params) {
cpSpaceActivateShapesTouchingShape(modChipmunk_cpEspacio, (cpShape *)params[0]);
return 0;
}
int modcpSpaceResizeStaticHash(INSTANCE *my, int *params) {
// cpHashResizeHash(modChipmunk_cpEspacio,*(( float * ) &params[0]),params[1]);
printf("Función en desuso\n");
return 0;
}
int modcpSpaceResizeActiveHash(INSTANCE *my, int *params) {
// cpSpaceResizeActiveHash(modChipmunk_cpEspacio,*(( float * ) &params[0]),params[1]);
printf("Función en desuso\n");
return 0;
}
int modcpSpaceUseSpatialHash(INSTANCE *my, int *params) {
cpSpaceUseSpatialHash(modChipmunk_cpEspacio, *(float *)&params[0], params[1]);
return 1;
}
#include "Espacio.h"
extern cpSpace *modChipmunk_cpEspacio;
int modcpSpaceGetCurrentTimeStep(INSTANCE *my, intptr_t *params) {
float r = cpSpaceGetCurrentTimeStep(modChipmunk_cpEspacio);
return *(int *)&r;
}
int modGetStaticBody(INSTANCE *my, intptr_t *params) {
return modChipmunk_cpEspacio->staticBody;
}
int modcpSpaceActivateShapesTouchingShape(INSTANCE *my, intptr_t *params) {
cpSpaceActivateShapesTouchingShape(modChipmunk_cpEspacio, (cpShape *)params[0]);
return 0;
}
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, intptr_t *params) {
// cpSpaceResizeActiveHash(modChipmunk_cpEspacio,*(( float * ) &params[0]),params[1]);
printf("Función en desuso\n");
return 0;
}
int modcpSpaceUseSpatialHash(INSTANCE *my, intptr_t *params) {
cpSpaceUseSpatialHash(modChipmunk_cpEspacio, *(float *)&params[0], params[1]);
return 1;
}
#ifndef ESPACIO_H
#define ESPACIO_H
#include <stdlib.h>
#include <math.h>
#include "chipmunk.h"
#include "pxtdl.h"
#include "pxtrtm.h"
#include "xstrings.h"
#include "dlvaracc.h"
#include "libdraw.h"
#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);
#endif
#ifndef ESPACIO_H
#define ESPACIO_H
#include <stdlib.h>
#include <math.h>
#include "chipmunk.h"
#include "pxtdl.h"
#include "pxtrtm.h"
#include "xstrings.h"
#include "dlvaracc.h"
#include "libdraw.h"
#include "librender.h"
#include "mod_map.h"
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);
#endif
This diff is collapsed.
#ifndef HANDLERS_H
#define HANDLERS_H
#include <stdlib.h>
#include <math.h>
#include "chipmunk.h"
#include "pxtdl.h"
#include "pxtrtm.h"
#include "xstrings.h"
#include "dlvaracc.h"
#include "libdraw.h"
#include "librender.h"
#include "mod_map.h"
#include "Arreglos.h"
#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);
void recogeColisionHandler(cpArbiter *arb, cpSpace *space, void *dat);
void buscaABCol(void *ptr, void *data);
typedef struct {
PROCDEF *funciones[4];
void *parametros[4];
int a, b;
} Hands;
void funcionElmHand(void *v);
#endif
#ifndef HANDLERS_H
#define HANDLERS_H
#include <stdlib.h>
#include <math.h>
#include "chipmunk.h"
#include "pxtdl.h"
#include "pxtrtm.h"
#include "xstrings.h"
#include "dlvaracc.h"
#include "libdraw.h"
#include "librender.h"
#include "mod_map.h"
#include "Arreglos.h"
#include "LL.h"
int beginCall(cpArbiter *arb, struct cpSpace *space, void *data);
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 {
PROCDEF *funciones[4];
void *parametros[4];
int a, b;
} Hands;
void funcionElmHand(void *v);
#endif
......@@ -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];
......
#ifndef AGUA_H
#define AGUA_H
#include "chipmunk.h"
#include "pxtdl.h"
#include "pxtrtm.h"
#include "xstrings.h"
#include "dlvaracc.h"
#include "g_bitmap.h"
#include "libdraw.h"
#include "librender.h"
#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);
#endif
#ifndef AGUA_H
#define AGUA_H
#include "chipmunk.h"
#include "pxtdl.h"
#include "pxtrtm.h"
#include "xstrings.h"
#include "dlvaracc.h"
#include "g_bitmap.h"
#include "libdraw.h"
#include "librender.h"
#include "mod_map.h"
#include "globales.h"
#include "locales.h"
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);
#endif
#include "arbitros.h"
typedef struct modChipmunkStruct_Data_Pointer {
int father;
int estado;
struct modChipmunkStruct_Data_Pointer *sig;
int x, y;
cpBody *body;
int angle;
int nShapes;
cpShape **Shapes;
int nConstraints;
cpConstraint **Constraints;
cpBody **constraintsBody;
int typeShape;
} * DataPointer;
int modArbiterGetNumContactPoints(INSTANCE *my, int *params) {
return cpArbiterGetCount((cpArbiter *)params[0]);
}
int modArbiterIsFirstContact(INSTANCE *my, int *params) {
return cpArbiterIsFirstContact((cpArbiter *)params[0]);
}
int modArbiterGetNormal(INSTANCE *my, int *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) {
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) {
float f = cpArbiterGetDepth((cpArbiter *)params[0], params[1]);
return *(int *)&f;
}
int modArbiterTotalImpulseWithFriction(INSTANCE *my, int *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) {
cpVect v = cpArbiterTotalImpulse((cpArbiter *)params[0]);
*(float *)params[1] = v.x;
*(float *)params[2] = v.y;
return 1;
}
int modArbiterProcessA(INSTANCE *my, int *params) {
cpBody *b, *c;
cpArbiterGetBodies((cpArbiter *)params[0], &b, &c);
return ((DataPointer)b->data)->father;
}
int modArbiterProcessB(INSTANCE *my, int *params) {
cpBody *b, *c;
cpArbiterGetBodies((cpArbiter *)params[0], &b, &c);
return ((DataPointer)c->data)->father;
}
int modArbiterGetElasticity(INSTANCE *my, int *params) {
float f = cpArbiterGetElasticity((cpArbiter *)params[0]);
return *(int *)&f;
}
int modArbiterSetElasticity(INSTANCE *my, int *params) {
cpArbiterSetElasticity((cpArbiter *)params[0], *(float *)&params[1]);
return 1;
}
int modArbiterGetFriction(INSTANCE *my, int *params) {
float f = cpArbiterGetFriction((cpArbiter *)params[0]);
return *(int *)&f;
}
int modArbiterSetFriction(INSTANCE *my, int *params) {
cpArbiterSetFriction((cpArbiter *)params[0], *(float *)&params[1]);
return 1;
}
int modArbiterGetSurfaceVelocity(INSTANCE *my, int *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) {
cpArbiterSetSurfaceVelocity((cpArbiter *)params[0],
cpv(*(float *)&params[1], *(float *)&params[2]));
return 1;
}
#include "arbitros.h"
typedef struct modChipmunkStruct_Data_Pointer {
int father;
int estado;
struct modChipmunkStruct_Data_Pointer *sig;
int x, y;
cpBody *body;
int angle;
int nShapes;
cpShape **Shapes;
int nConstraints;
cpConstraint **Constraints;
cpBody **constraintsBody;
int typeShape;
} * DataPointer;
int modArbiterGetNumContactPoints(INSTANCE *my, intptr_t *params) {
return cpArbiterGetCount((cpArbiter *)params[0]);
}
int modArbiterIsFirstContact(INSTANCE *my, intptr_t *params) {
return cpArbiterIsFirstContact((cpArbiter *)params[0]);
}
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;
}