S7 header config & prototyping support

This commit is contained in:
2023-01-05 00:09:42 +00:00
parent 740077fae3
commit 1521593269
9 changed files with 36 additions and 10 deletions

View File

@@ -33,6 +33,14 @@ int id_from_gameobject(struct gameobject *go) {
return -1;
}
void gameobject_apply(struct gameobject *go)
{
cpBodySetType(go->body, go->bodytype);
if (go->bodytype == CP_BODY_TYPE_DYNAMIC)
cpBodySetMass(go->body, go->mass);
}
static void gameobject_setpickcolor(struct gameobject *go)
{
float r = ((go->editor.id & 0x000000FF) >> 0) / 255.f;
@@ -144,6 +152,8 @@ void gameobject_init(struct gameobject *go, FILE * fprefab)
cpBodySetType(go->body, go->bodytype);
cpBodySetUserData(go->body, go);
int comp_n;
fread(&comp_n, sizeof(int), 1, fprefab);
arrfree(go->components);