remove ur from components

This commit is contained in:
2023-09-27 14:37:20 +00:00
parent 1143b9b3dc
commit 7984c90140
9 changed files with 20 additions and 64 deletions

View File

@@ -203,6 +203,7 @@ struct phys2d_circle *Make2DCircle(int go) {
new->shape.moi = phys2d_circle_moi;
new->shape.apply = phys2d_applycircle;
init_phys2dshape(&new->shape, go, new);
phys2d_applycircle(new);
return new;
}

View File

@@ -51,7 +51,7 @@ static void render_audio(plm_t *mpeg, plm_samples_t *samples, void *user) {
}
void ds_openvideo(struct datastream *ds, const char *video, const char *adriver) {
long rawlen;
size_t rawlen;
void *raw;
raw = slurp_file(video, &rawlen);
ds->plm = plm_create_with_memory(raw, rawlen, 0);

View File

@@ -1458,13 +1458,8 @@ JSValue duk_cmd_box2d(JSContext *js, JSValueConst this, int argc, JSValueConst *
JSValue duk_make_circle2d(JSContext *js, JSValueConst this, int argc, JSValueConst *argv) {
int go = js2int(argv[0]);
double radius = js2number(argv[1]);
struct phys2d_circle *circle = Make2DCircle(go);
circle->radius = radius;
circle->offset = js2vec2(argv[2]);
phys2d_applycircle(circle);
JSValue circleval = JS_NewObject(js);
JS_SetPropertyStr(js, circleval, "id", ptr2js(circle));
@@ -1657,7 +1652,7 @@ void ffi_load() {
DUK_FUNC(make_box2d, 3)
DUK_FUNC(cmd_box2d, 6)
DUK_FUNC(make_circle2d, 3)
DUK_FUNC(make_circle2d, 1)
DUK_FUNC(cmd_circle2d, 6)
DUK_FUNC(make_poly2d, 2)
DUK_FUNC(cmd_poly2d, 6)