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 @@ ...@@ -3,3 +3,4 @@
*.a *.a
*.dcb *.dcb
.idea .idea
/3rdparty/steamworks
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
* Helper function preparing params * Helper function preparing params
**/ **/
static bgdata *prep(int *params) { static bgdata *prep(intptr_t *params) {
bgdata *t = (bgdata *)malloc(sizeof(bgdata)); bgdata *t = (bgdata *)malloc(sizeof(bgdata));
t->file = strdup((char *)string_get(params[0])); t->file = strdup((char *)string_get(params[0]));
t->id = (int *)params[1]; t->id = (int *)params[1];
...@@ -71,7 +71,7 @@ int bgDoLoad(void *d) { ...@@ -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); bgdata *t = prep(params);
t->fn = fn; t->fn = fn;
......
...@@ -39,7 +39,7 @@ typedef struct { ...@@ -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 #ifndef CONSTRAINTS_H
#define CONSTRAINTS_H #define CONSTRAINTS_H
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include "chipmunk.h" #include "chipmunk.h"
#include "pxtdl.h" #include "pxtdl.h"
#include "pxtrtm.h" #include "pxtrtm.h"
#include "xstrings.h" #include "xstrings.h"
#include "dlvaracc.h" #include "dlvaracc.h"
#include "libdraw.h" #include "libdraw.h"
#include "librender.h" #include "librender.h"
#include "mod_map.h" #include "mod_map.h"
// int addConstr(cpBody *bod1, cpBody *bod2,cpConstraint * cons); // int addConstr(cpBody *bod1, cpBody *bod2,cpConstraint * cons);
int modaddDampedSpring(INSTANCE *my, int *params); int modaddDampedSpring(INSTANCE *my, intptr_t *params);
int modaddPinJoint(INSTANCE *my, int *params); int modaddPinJoint(INSTANCE *my, intptr_t *params);
int modaddPivotJoint2(INSTANCE *my, int *params); int modaddPivotJoint2(INSTANCE *my, intptr_t *params);
int modaddSlideJoint(INSTANCE *my, int *params); int modaddSlideJoint(INSTANCE *my, intptr_t *params);
int modaddGrooveJoint(INSTANCE *my, int *params); int modaddGrooveJoint(INSTANCE *my, intptr_t *params);
int modaddSimpleMotor(INSTANCE *my, int *params); int modaddSimpleMotor(INSTANCE *my, intptr_t *params);
int modaddRatchetJoint(INSTANCE *my, int *params); int modaddRatchetJoint(INSTANCE *my, intptr_t *params);
int modaddRotaryLimitJoint(INSTANCE *my, int *params); int modaddRotaryLimitJoint(INSTANCE *my, intptr_t *params);
int modaddGearJoint(INSTANCE *my, int *params); int modaddGearJoint(INSTANCE *my, intptr_t *params);
int modaddDampedRotarySpring(INSTANCE *my, int *params); int modaddDampedRotarySpring(INSTANCE *my, intptr_t *params);
int modaddPivotJoint(INSTANCE *my, int *params); int modaddPivotJoint(INSTANCE *my, intptr_t *params);
int modsetPinJointProperties(INSTANCE *my, int *params); int modsetPinJointProperties(INSTANCE *my, intptr_t *params);
int modsetSlideJointProperties(INSTANCE *my, int *params); int modsetSlideJointProperties(INSTANCE *my, intptr_t *params);
int modsetPivotJointProperties(INSTANCE *my, int *params); int modsetPivotJointProperties(INSTANCE *my, intptr_t *params);
int modsetGrooveJointProperties(INSTANCE *my, int *params); int modsetGrooveJointProperties(INSTANCE *my, intptr_t *params);
int modsetDampedSpringProperties(INSTANCE *my, int *params); int modsetDampedSpringProperties(INSTANCE *my, intptr_t *params);
int modsetDampedRotarySpringProperties(INSTANCE *my, int *params); int modsetDampedRotarySpringProperties(INSTANCE *my, intptr_t *params);
int modsetRotaryLimitJointProperties(INSTANCE *my, int *params); int modsetRotaryLimitJointProperties(INSTANCE *my, intptr_t *params);
int modsetRatchetJointProperties(INSTANCE *my, int *params); int modsetRatchetJointProperties(INSTANCE *my, intptr_t *params);
int modsetGearJointProperties(INSTANCE *my, int *params); int modsetGearJointProperties(INSTANCE *my, intptr_t *params);
int modsetSimpleMotorProperties(INSTANCE *my, int *params); int modsetSimpleMotorProperties(INSTANCE *my, intptr_t *params);
int modgetPinJointProperties(INSTANCE *my, int *params); int modgetPinJointProperties(INSTANCE *my, intptr_t *params);
int modgetSlideJointProperties(INSTANCE *my, int *params); int modgetSlideJointProperties(INSTANCE *my, intptr_t *params);
int modgetPivotJointProperties(INSTANCE *my, int *params); int modgetPivotJointProperties(INSTANCE *my, intptr_t *params);
int modgetGrooveJointProperties(INSTANCE *my, int *params); int modgetGrooveJointProperties(INSTANCE *my, intptr_t *params);
int modgetDampedSpringProperties(INSTANCE *my, int *params); int modgetDampedSpringProperties(INSTANCE *my, intptr_t *params);
int modgetDampedRotarySpringProperties(INSTANCE *my, int *params); int modgetDampedRotarySpringProperties(INSTANCE *my, intptr_t *params);
int modgetRotaryLimitJointProperties(INSTANCE *my, int *params); int modgetRotaryLimitJointProperties(INSTANCE *my, intptr_t *params);
int modgetRatchetJointProperties(INSTANCE *my, int *params); int modgetRatchetJointProperties(INSTANCE *my, intptr_t *params);
int modgetGearJointProperties(INSTANCE *my, int *params); int modgetGearJointProperties(INSTANCE *my, intptr_t *params);
int modgetSimpleMotorProperties(INSTANCE *my, int *params); int modgetSimpleMotorProperties(INSTANCE *my, intptr_t *params);
int modcpConstraintGetImpulse(INSTANCE *my, int *params); int modcpConstraintGetImpulse(INSTANCE *my, intptr_t *params);
int modDefcpConstraint(INSTANCE *my, int *params); int modDefcpConstraint(INSTANCE *my, intptr_t *params);
int modGetcpConstraint(INSTANCE *my, int *params); int modGetcpConstraint(INSTANCE *my, intptr_t *params);
int modcpConstraintSetPostSolveFunc(INSTANCE *my, int *params); int modcpConstraintSetPostSolveFunc(INSTANCE *my, intptr_t *params);
int modcpConstraintSetPreSolveFunc(INSTANCE *my, int *params); int modcpConstraintSetPreSolveFunc(INSTANCE *my, intptr_t *params);
int modGetFathetA(INSTANCE *my, int *params); int modGetFathetA(INSTANCE *my, intptr_t *params);
int modGetFathetB(INSTANCE *my, int *params); int modGetFathetB(INSTANCE *my, intptr_t *params);
int modremoveConstraint(INSTANCE *my, int *params); int modremoveConstraint(INSTANCE *my, intptr_t *params);
void eliminaConstraint(void *par); void eliminaConstraint(void *par);
#endif #endif
This diff is collapsed.
#ifndef CUERPO_H #ifndef CUERPO_H
#define CUERPO_H #define CUERPO_H
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include "chipmunk.h" #include "chipmunk.h"
#include "pxtdl.h" #include "pxtdl.h"
#include "pxtrtm.h" #include "pxtrtm.h"
#include "xstrings.h" #include "xstrings.h"
#include "dlvaracc.h" #include "dlvaracc.h"
#include "libdraw.h" #include "libdraw.h"
#include "librender.h" #include "librender.h"
#include "mod_map.h" #include "mod_map.h"
#include "Arreglos.h" #include "Arreglos.h"
#include "LL.h" #include "LL.h"
int modgetBody(INSTANCE *my, int *params); int modgetBody(INSTANCE *my, intptr_t *params);
int modcpBodyLocal2World(INSTANCE *my, int *params); int modcpBodyLocal2World(INSTANCE *my, intptr_t *params);
int modDefcpBody(INSTANCE *my, int *params); int modDefcpBody(INSTANCE *my, intptr_t *params);
int modGetEcpBody(INSTANCE *my, int *params); int modGetEcpBody(INSTANCE *my, intptr_t *params);
int modcpBodySetMass(INSTANCE *my, int *params); int modcpBodySetMass(INSTANCE *my, intptr_t *params);
int modcpBodySetMoment(INSTANCE *my, int *params); int modcpBodySetMoment(INSTANCE *my, intptr_t *params);
int modcpBodySetAngle(INSTANCE *my, int *params); int modcpBodySetAngle(INSTANCE *my, intptr_t *params);
int modcpBodyUpdatePosition(INSTANCE *my, int *params); int modcpBodyUpdatePosition(INSTANCE *my, intptr_t *params);
int modcpBodyResetForces(INSTANCE *my, int *params); int modcpBodyResetForces(INSTANCE *my, intptr_t *params);
int modcpBodyIsSleeping(INSTANCE *my, int *params); int modcpBodyIsSleeping(INSTANCE *my, intptr_t *params);
int modcpBodySleep(INSTANCE *my, int *params); int modcpBodySleep(INSTANCE *my, intptr_t *params);
int modcpBodyActivate(INSTANCE *my, int *params); int modcpBodyActivate(INSTANCE *my, intptr_t *params);
int modcpBodyIsStatic(INSTANCE *my, int *params); int modcpBodyIsStatic(INSTANCE *my, intptr_t *params);
int modcpBodyIsRogue(INSTANCE *my, int *params); int modcpBodyIsRogue(INSTANCE *my, intptr_t *params);
int modcpBodySleepWithGroup(INSTANCE *my, int *params); int modcpBodySleepWithGroup(INSTANCE *my, intptr_t *params);
int modcpBodyApplyForce(INSTANCE *my, int *params); int modcpBodyApplyForce(INSTANCE *my, intptr_t *params);
int modcpBodyApplyImpulse(INSTANCE *my, int *params); int modcpBodyApplyImpulse(INSTANCE *my, intptr_t *params);
int modcpBodyWorld2Local(INSTANCE *my, int *params); int modcpBodyWorld2Local(INSTANCE *my, intptr_t *params);
int modcpBodySlew(INSTANCE *my, int *params); int modcpBodySlew(INSTANCE *my, intptr_t *params);
int modcpBodyUpdateVelocity(INSTANCE *my, int *params); int modcpBodyUpdateVelocity(INSTANCE *my, intptr_t *params);
int modActivateProcessTouchingIt(INSTANCE *my, int *params); int modActivateProcessTouchingIt(INSTANCE *my, intptr_t *params);
void addListaProcesos(INSTANCE *ins); void addListaProcesos(INSTANCE *ins);
int modaddCircleShape(INSTANCE *my, int *params); int modaddCircleShape(INSTANCE *my, intptr_t *params);
int modaddSegmentShape(INSTANCE *my, int *params); int modaddSegmentShape(INSTANCE *my, intptr_t *params);
int modaddPolyShape(INSTANCE *my, int *params); int modaddPolyShape(INSTANCE *my, intptr_t *params);
int creaPoly(int *params, cpBody *bod); 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 #define ajustaTam LOCDWORD(mod_chipmunk, my, LOC_SIZE) / 100.0
int creaBodyAndShapeAutomat(INSTANCE *my); int creaBodyAndShapeAutomat(INSTANCE *my);
int modcpCalculaConvexHull(INSTANCE *my, int *params); int modcpCalculaConvexHull(INSTANCE *my, intptr_t *params);
#endif #endif
#include "Espacio.h" #include "Espacio.h"
extern cpSpace *modChipmunk_cpEspacio; extern cpSpace *modChipmunk_cpEspacio;
int modcpSpaceGetCurrentTimeStep(INSTANCE *my, int *params) { int modcpSpaceGetCurrentTimeStep(INSTANCE *my, intptr_t *params) {
float r = cpSpaceGetCurrentTimeStep(modChipmunk_cpEspacio); float r = cpSpaceGetCurrentTimeStep(modChipmunk_cpEspacio);
return *(int *)&r; return *(int *)&r;
} }
int modGetStaticBody(INSTANCE *my, int *params) { int modGetStaticBody(INSTANCE *my, intptr_t *params) {
return modChipmunk_cpEspacio->staticBody; return modChipmunk_cpEspacio->staticBody;
} }
int modcpSpaceActivateShapesTouchingShape(INSTANCE *my, int *params) { int modcpSpaceActivateShapesTouchingShape(INSTANCE *my, intptr_t *params) {
cpSpaceActivateShapesTouchingShape(modChipmunk_cpEspacio, (cpShape *)params[0]); cpSpaceActivateShapesTouchingShape(modChipmunk_cpEspacio, (cpShape *)params[0]);
return 0; return 0;
} }
int modcpSpaceResizeStaticHash(INSTANCE *my, int *params) { int modcpSpaceResizeStaticHash(INSTANCE *my, intptr_t *params) {
// cpHashResizeHash(modChipmunk_cpEspacio,*(( float * ) &params[0]),params[1]); // cpHashResizeHash(modChipmunk_cpEspacio,*(( float * ) &params[0]),params[1]);
printf("Función en desuso\n"); printf("Función en desuso\n");
return 0; return 0;
} }
int modcpSpaceResizeActiveHash(INSTANCE *my, int *params) { int modcpSpaceResizeActiveHash(INSTANCE *my, intptr_t *params) {
// cpSpaceResizeActiveHash(modChipmunk_cpEspacio,*(( float * ) &params[0]),params[1]); // cpSpaceResizeActiveHash(modChipmunk_cpEspacio,*(( float * ) &params[0]),params[1]);
printf("Función en desuso\n"); printf("Función en desuso\n");
return 0; return 0;
} }
int modcpSpaceUseSpatialHash(INSTANCE *my, int *params) { int modcpSpaceUseSpatialHash(INSTANCE *my, intptr_t *params) {
cpSpaceUseSpatialHash(modChipmunk_cpEspacio, *(float *)&params[0], params[1]); cpSpaceUseSpatialHash(modChipmunk_cpEspacio, *(float *)&params[0], params[1]);
return 1; return 1;
} }
#ifndef ESPACIO_H #ifndef ESPACIO_H
#define ESPACIO_H #define ESPACIO_H
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include "chipmunk.h" #include "chipmunk.h"
#include "pxtdl.h" #include "pxtdl.h"
#include "pxtrtm.h" #include "pxtrtm.h"
#include "xstrings.h" #include "xstrings.h"
#include "dlvaracc.h" #include "dlvaracc.h"
#include "libdraw.h" #include "libdraw.h"
#include "librender.h" #include "librender.h"
#include "mod_map.h" #include "mod_map.h"
int modcpSpaceGetCurrentTimeStep(INSTANCE *my, int *params); int modcpSpaceGetCurrentTimeStep(INSTANCE *my, intptr_t *params);
int modGetStaticBody(INSTANCE *my, int *params); int modGetStaticBody(INSTANCE *my, intptr_t *params);
int modcpSpaceActivateShapesTouchingShape(INSTANCE *my, int *params); int modcpSpaceActivateShapesTouchingShape(INSTANCE *my, intptr_t *params);
int modcpSpaceResizeStaticHash(INSTANCE *my, int *params); int modcpSpaceResizeStaticHash(INSTANCE *my, intptr_t *params);
int modcpSpaceResizeActiveHash(INSTANCE *my, int *params); int modcpSpaceResizeActiveHash(INSTANCE *my, intptr_t *params);
int modcpSpaceUseSpatialHash(INSTANCE *my, int *params); int modcpSpaceUseSpatialHash(INSTANCE *my, intptr_t *params);
#endif #endif
This diff is collapsed.
#ifndef HANDLERS_H #ifndef HANDLERS_H
#define HANDLERS_H #define HANDLERS_H
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include "chipmunk.h" #include "chipmunk.h"
#include "pxtdl.h" #include "pxtdl.h"
#include "pxtrtm.h" #include "pxtrtm.h"
#include "xstrings.h" #include "xstrings.h"
#include "dlvaracc.h" #include "dlvaracc.h"
#include "libdraw.h" #include "libdraw.h"
#include "librender.h" #include "librender.h"
#include "mod_map.h" #include "mod_map.h"
#include "Arreglos.h" #include "Arreglos.h"
#include "LL.h" #include "LL.h"
int beginCall(cpArbiter *arb, struct cpSpace *space, void *data); int beginCall(cpArbiter *arb, struct cpSpace *space, void *data);
int modcpSpaceAddCollisionHandler(INSTANCE *my, int *params); int modcpSpaceAddCollisionHandler(INSTANCE *my, intptr_t *params);
int modcpSpaceRemoveCollisionHandler(INSTANCE *my, int *params); int modcpSpaceRemoveCollisionHandler(INSTANCE *my, intptr_t *params);
int modremoveHandler(INSTANCE *my, int *params); int modremoveHandler(INSTANCE *my, intptr_t *params);
int modcrearHandler(INSTANCE *my, int *params); int modcrearHandler(INSTANCE *my, intptr_t *params);
void recogeColisionHandler(cpArbiter *arb, cpSpace *space, void *dat); void recogeColisionHandler(cpArbiter *arb, cpSpace *space, void *dat);
void buscaABCol(void *ptr, void *data); void buscaABCol(void *ptr, void *data);
typedef struct { typedef struct {
PROCDEF *funciones[4]; PROCDEF *funciones[4];
void *parametros[4]; void *parametros[4];
int a, b; int a, b;
} Hands; } Hands;
void funcionElmHand(void *v); void funcionElmHand(void *v);
#endif #endif
...@@ -57,7 +57,7 @@ static inline int Metaball(int x, int y, int *xp, int *yp, int tam, float t, flo ...@@ -57,7 +57,7 @@ static inline int Metaball(int x, int y, int *xp, int *yp, int tam, float t, flo
return v > tr; return v > tr;
} }
// encontrar minx y miny para el pintado... // 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]); GRAPH *map = bitmap_get(params[0], params[1]);
int anc = map->width; int anc = map->width;
int alt = map->height; int alt = map->height;
...@@ -109,7 +109,7 @@ int modChipmunkPintaAgua(INSTANCE *my, int *params) { ...@@ -109,7 +109,7 @@ int modChipmunkPintaAgua(INSTANCE *my, int *params) {
map->needs_texture_update = 1; 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); // 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; float v = 0.0, a, b, t;
int z; int z;
...@@ -126,7 +126,7 @@ int modChipmunkMetaball(INSTANCE *my, int *params) { ...@@ -126,7 +126,7 @@ int modChipmunkMetaball(INSTANCE *my, int *params) {
return v > (*(float *)&params[5]); 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]; ((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 ...@@ -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 kdt = *(float *)GLOADDR(mod_chipmunk, GLO_INTERVAL) /
(float)GLODWORD(mod_chipmunk, GLO_PHRESOLUTION); (float)GLODWORD(mod_chipmunk, GLO_PHRESOLUTION);
WaterS *ws = params[0]; WaterS *ws = params[0];
......
#ifndef AGUA_H #ifndef AGUA_H
#define AGUA_H #define AGUA_H
#include "chipmunk.h" #include "chipmunk.h"
#include "pxtdl.h" #include "pxtdl.h"
#include "pxtrtm.h" #include "pxtrtm.h"
#include "xstrings.h" #include "xstrings.h"
#include "dlvaracc.h" #include "dlvaracc.h"
#include "g_bitmap.h" #include "g_bitmap.h"
#include "libdraw.h" #include "libdraw.h"
#include "librender.h" #include "librender.h"
#include "mod_map.h" #include "mod_map.h"
#include "globales.h" #include "globales.h"
#include "locales.h" #include "locales.h"
int modChipmunkPintaAgua(INSTANCE *my, int *params); int modChipmunkPintaAgua(INSTANCE *my, intptr_t *params);
int modChipmunkMetaball(INSTANCE *my, int *params); int modChipmunkMetaball(INSTANCE *my, intptr_t *params);
int modChipmunkSetEfector(INSTANCE *my, int *params); int modChipmunkSetEfector(INSTANCE *my, intptr_t *params);
int modChipmunkEmulateAgua(INSTANCE *my, int *params); int modChipmunkEmulateAgua(INSTANCE *my, intptr_t *params);
#endif #endif
#include "arbitros.h" #include "arbitros.h"
typedef struct modChipmunkStruct_Data_Pointer { typedef struct modChipmunkStruct_Data_Pointer {
int father; int father;
int estado; int estado;
struct modChipmunkStruct_Data_Pointer *sig; struct modChipmunkStruct_Data_Pointer *sig;
int x, y; int x, y;
cpBody *body; cpBody *body;
int angle; int angle;
int nShapes; int nShapes;
cpShape **Shapes; cpShape **Shapes;
int nConstraints; int nConstraints;
cpConstraint **Constraints; cpConstraint **Constraints;
cpBody **constraintsBody; cpBody **constraintsBody;
int typeShape; int typeShape;
} * DataPointer; } * DataPointer;
int modArbiterGetNumContactPoints(INSTANCE *my, int *params) { int modArbiterGetNumContactPoints(INSTANCE *my, intptr_t *params) {
return cpArbiterGetCount((cpArbiter *)params[0]); return cpArbiterGetCount((cpArbiter *)params[0]);
} }
int modArbiterIsFirstContact(INSTANCE *my, int *params) { int modArbiterIsFirstContact(INSTANCE *my, intptr_t *params) {
return cpArbiterIsFirstContact((cpArbiter *)params[0]); 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]); cpVect v = cpArbiterGetNormal((cpArbiter *)params[0], params[1]);
*(float *)params[2] = v.x; *(float *)params[2] = v.x;
*(float *)params[3] = v.y; *(float *)params[3] = v.y;
return 1; return 1;
} }
int modArbiterGetPoint(INSTANCE *my, int *params) { int modArbiterGetPoint(INSTANCE *my, intptr_t *params) {
cpVect v = cpArbiterGetPoint((cpArbiter *)params[0], params[1]); cpVect v = cpArbiterGetPoint((cpArbiter *)params[0], params[1]);
*(float *)params[2] = v.x; *(float *)params[2] = v.x;
*(float *)params[3] = v.y; *(float *)params[3] = v.y;
return 1; return 1;
} }
int modArbiterGetDepth(INSTANCE *my, int *params) { int modArbiterGetDepth(INSTANCE *my, intptr_t *params) {
float f = cpArbiterGetDepth((cpArbiter *)params[0], params[1]); float f = cpArbiterGetDepth((cpArbiter *)params[0], params[1]);
return *(int *)&f; return *(int *)&f;
} }
int modArbiterTotalImpulseWithFriction(INSTANCE *my, int *params) { int modArbiterTotalImpulseWithFriction(INSTANCE *my, intptr_t *params) {
cpVect v = cpArbiterTotalImpulseWithFriction((cpArbiter *)params[0]); cpVect v = cpArbiterTotalImpulseWithFriction((cpArbiter *)params[0]);
*(float *)params[1] = v.x; *(float *)params[1] = v.x;
*(float *)params[2] = v.y; *(float *)params[2] = v.y;
return 1; return 1;
} }
int modArbiterTotalImpulse(INSTANCE *my, int *params) { int modArbiterTotalImpulse(INSTANCE *my, intptr_t *params) {
cpVect v = cpArbiterTotalImpulse((cpArbiter *)params[0]); cpVect v = cpArbiterTotalImpulse((cpArbiter *)params[0]);
*(float *)params[1] = v.x; *(float *)params[1] = v.x;
*(float *)params[2] = v.y; *(float *)params[2] = v.y;
return 1; return 1;
} }
int modArbiterProcessA(INSTANCE *my, int *params) { int modArbiterProcessA(INSTANCE *my, intptr_t *params) {
cpBody *b, *c; cpBody *b, *c;
cpArbiterGetBodies((cpArbiter *)params[0], &b, &c); cpArbiterGetBodies((cpArbiter *)params[0], &b, &c);
return ((DataPointer)b->data)->father; return ((DataPointer)b->data)->father;
} }
int modArbiterProcessB(INSTANCE *my, int *params) { int modArbiterProcessB(INSTANCE *my, intptr_t *params) {
cpBody *b, *c; cpBody *b, *c;
cpArbiterGetBodies((cpArbiter *)params[0], &b, &c); cpArbiterGetBodies((cpArbiter *)params[0], &b, &c);
return ((DataPointer)c->data)->father; return ((DataPointer)c->data)->father;
} }
int modArbiterGetElasticity(INSTANCE *my, int *params) { int modArbiterGetElasticity(INSTANCE *my, intptr_t *params) {
float f = cpArbiterGetElasticity((cpArbiter *)params[0]); float f = cpArbiterGetElasticity((cpArbiter *)params[0]);
return *(int *)&f; return *(int *)&f;
} }
int modArbiterSetElasticity(INSTANCE *my, int *params) { int modArbiterSetElasticity(INSTANCE *my, intptr_t *params) {
cpArbiterSetElasticity((cpArbiter *)params[0], *(float *)&params[1]); cpArbiterSetElasticity((cpArbiter *)params[0], *(float *)&params[1]);
return 1; return 1;