-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathchipmunk.replacements
42 lines (36 loc) · 2.06 KB
/
chipmunk.replacements
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
convert c: #define cpAssertWarn(__condition__, ...) if (!(__condition__)) cpMessage(#__condition__, __FILE__, __LINE__, 0, 0, __VA_ARGS__)
to c: #define cpAssertWarn(__condition__, ...) if (!(__condition__)) cpMessage(#__condition__, __FILE__, __LINE__, 0, 0, __VA_ARGS__);
convert c: #define CP_ARBITER_GET_SHAPES(__arb__, __a__, __b__) cpShape *__a__, *__b__; cpArbiterGetShapes(__arb__, &__a__, &__b__);
to fb: #define CP_ARBITER_GET_SHAPES(__arb__, __a__, __b__) dim as cpShape ptr __a__, __b__ : cpArbiterGetShapes(__arb__, @__a__, @__b__)
convert c: #define CP_ARBITER_GET_BODIES(__arb__, __a__, __b__) cpBody *__a__, *__b__; cpArbiterGetBodies(__arb__, &__a__, &__b__);
to fb: #define CP_ARBITER_GET_BODIES(__arb__, __a__, __b__) dim as cpBody ptr __a__, __b__ : cpArbiterGetBodies(__arb__, @__a__, @__b__)
convert c:
#define CP_CONVEX_HULL(__count__, __verts__, __count_var__, __verts_var__) \
cpVect *__verts_var__ = (cpVect *)alloca(__count__*sizeof(cpVect)); \
int __count_var__ = cpConvexHull(__count__, __verts__, __verts_var__, NULL, 0.0);
to fb:
#macro CP_CONVEX_HULL(__count__, __verts__, __count_var__, __verts_var__)
dim as cpVect ptr __verts_var__ = cptr(cpVect ptr, alloca(__count__ * sizeof(cpVect)))
dim as long __count_var__ = cpConvexHull(__count__, __verts__, __verts_var__, NULL, 0.0)
#endmacro
convert c:
static inline cpBB cpBBNew(const cpFloat l, const cpFloat b, const cpFloat r, const cpFloat t) {
cpBB bb = {l, b, r, t};
return bb;
}
to fb:
#define cpBBNew(l, b, r, t) type<cpBB>(l, b, r, t)
convert c:
static inline cpTransform cpTransformNew(cpFloat a, cpFloat b, cpFloat c, cpFloat d, cpFloat tx, cpFloat ty) {
cpTransform t = {a, b, c, d, tx, ty};
return t;
}
to fb:
#define cpTransformNew(a, b, c, d, tx, ty) type<cpTransform>(a, b, c, d, tx, ty)
convert c:
static inline cpTransform cpTransformNewTranspose(cpFloat a, cpFloat c, cpFloat tx, cpFloat b, cpFloat d, cpFloat ty) {
cpTransform t = {a, b, c, d, tx, ty};
return t;
}
to fb:
#define cpTransformNewTranspose(a, c, tx, b, d, ty) type<cpTransform>(a, b, c, d, tx, ty)