diff options
author | David Walter Seikel | 2016-02-06 22:14:01 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-02-06 22:14:01 +1000 |
commit | 6a15944f255d0d9653573ad0857e527f58f5f997 (patch) | |
tree | 160c55c97b259b884b4d8cff29516049dad390c2 /src/extantz | |
parent | Put the ~/.SledHamr/ creation code into all three main binaries. sigh (diff) | |
download | SledjHamr-6a15944f255d0d9653573ad0857e527f58f5f997.zip SledjHamr-6a15944f255d0d9653573ad0857e527f58f5f997.tar.gz SledjHamr-6a15944f255d0d9653573ad0857e527f58f5f997.tar.bz2 SledjHamr-6a15944f255d0d9653573ad0857e527f58f5f997.tar.xz |
Pass stuff size up to C code.
This is getting unweildy. lol
Diffstat (limited to 'src/extantz')
-rw-r--r-- | src/extantz/extantz.h | 2 | ||||
-rw-r--r-- | src/extantz/scenri.c | 15 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/extantz/extantz.h b/src/extantz/extantz.h index ccafc01..1f62496 100644 --- a/src/extantz/extantz.h +++ b/src/extantz/extantz.h | |||
@@ -291,7 +291,7 @@ Eina_Bool animateScene(globals *ourGlobals); | |||
291 | void scenriDel(Scene_Data *scene); | 291 | void scenriDel(Scene_Data *scene); |
292 | void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake); | 292 | void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake); |
293 | ExtantzStuffs *addStuffs(char *uuid, char *name, char *description, char *owner, | 293 | ExtantzStuffs *addStuffs(char *uuid, char *name, char *description, char *owner, |
294 | char *file, MeshType type, double px, double py, double pz, double rx, double ry, double rz, double rw); | 294 | char *file, MeshType type, double px, double py, double pz, double rx, double ry, double rz, double rw, double sx, double sy, double sz); |
295 | void addMaterial(ExtantzStuffs *e, int face, TextureType type, char *file); | 295 | void addMaterial(ExtantzStuffs *e, int face, TextureType type, char *file); |
296 | 296 | ||
297 | winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool save); | 297 | winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool save); |
diff --git a/src/extantz/scenri.c b/src/extantz/scenri.c index d37667b..1f51687 100644 --- a/src/extantz/scenri.c +++ b/src/extantz/scenri.c | |||
@@ -212,9 +212,9 @@ static int _partFillStuffs(lua_State *L) | |||
212 | ExtantzStuffs *result = NULL; | 212 | ExtantzStuffs *result = NULL; |
213 | Scene_Data *scene = NULL; | 213 | Scene_Data *scene = NULL; |
214 | char *name, *file; | 214 | char *name, *file; |
215 | double px, py, pz, rx, ry, rz, rw; | 215 | double px, py, pz, rx, ry, rz, rw, sx, sy, sz; |
216 | 216 | ||
217 | pull_lua(L, 1, "$ $ # # # # # # #", &name, &file, &px, &py, &pz, &rx, &ry, &rz, &rw); | 217 | pull_lua(L, 1, "$ $ # # # # # # # # # #", &name, &file, &px, &py, &pz, &rx, &ry, &rz, &rw, &sx, &sy, &sz); |
218 | lua_getfield(L, LUA_REGISTRYINDEX, "sceneData"); | 218 | lua_getfield(L, LUA_REGISTRYINDEX, "sceneData"); |
219 | scene = (Scene_Data *) lua_touserdata(L, -1); | 219 | scene = (Scene_Data *) lua_touserdata(L, -1); |
220 | 220 | ||
@@ -227,6 +227,7 @@ static int _partFillStuffs(lua_State *L) | |||
227 | strcpy(result->stuffs.file, file); | 227 | strcpy(result->stuffs.file, file); |
228 | result->stuffs.details.mesh->pos.x = px; result->stuffs.details.mesh->pos.y = py; result->stuffs.details.mesh->pos.z = pz; | 228 | result->stuffs.details.mesh->pos.x = px; result->stuffs.details.mesh->pos.y = py; result->stuffs.details.mesh->pos.z = pz; |
229 | result->stuffs.details.mesh->rot.x = rx; result->stuffs.details.mesh->rot.y = ry; result->stuffs.details.mesh->rot.z = rz; result->stuffs.details.mesh->rot.w = rw; | 229 | result->stuffs.details.mesh->rot.x = rx; result->stuffs.details.mesh->rot.y = ry; result->stuffs.details.mesh->rot.z = rz; result->stuffs.details.mesh->rot.w = rw; |
230 | result->stuffs.details.mesh->size.x = sx; result->stuffs.details.mesh->size.y = sy; result->stuffs.details.mesh->size.z = sz; | ||
230 | result->stage = ES_PART; | 231 | result->stage = ES_PART; |
231 | break; | 232 | break; |
232 | } | 233 | } |
@@ -275,10 +276,10 @@ static int _addStuffsL(lua_State *L) | |||
275 | ExtantzStuffs *result = NULL; | 276 | ExtantzStuffs *result = NULL; |
276 | char *uuid, *name, *description, *owner, *file; | 277 | char *uuid, *name, *description, *owner, *file; |
277 | int type; | 278 | int type; |
278 | double px, py, pz, rx, ry, rz, rw; | 279 | double px, py, pz, rx, ry, rz, rw, sx, sy, sz; |
279 | 280 | ||
280 | pull_lua(L, 1, "$ $ $ $ $ % # # # # # # #", &uuid, &name, &description, &owner, &file, &type, &px, &py, &pz, &rx, &ry, &rz, &rw); | 281 | pull_lua(L, 1, "$ $ $ $ $ % # # # # # # # # # #", &uuid, &name, &description, &owner, &file, &type, &px, &py, &pz, &rx, &ry, &rz, &rw, &sx, &sy, &sz); |
281 | result = addStuffs(uuid, name, description, owner, file, type, px, py, pz, rx, ry, rz, rw); | 282 | result = addStuffs(uuid, name, description, owner, file, type, px, py, pz, rx, ry, rz, rw, sx, sy, sz); |
282 | if (result) | 283 | if (result) |
283 | { | 284 | { |
284 | lua_getfield(L, LUA_REGISTRYINDEX, "sceneData"); | 285 | lua_getfield(L, LUA_REGISTRYINDEX, "sceneData"); |
@@ -670,6 +671,7 @@ void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake) | |||
670 | eo_key_data_set("Name", stuffs->stuffs.name), | 671 | eo_key_data_set("Name", stuffs->stuffs.name), |
671 | evas_canvas3d_node_position_set(stuffs->stuffs.details.mesh->pos.x, stuffs->stuffs.details.mesh->pos.y, stuffs->stuffs.details.mesh->pos.z), | 672 | evas_canvas3d_node_position_set(stuffs->stuffs.details.mesh->pos.x, stuffs->stuffs.details.mesh->pos.y, stuffs->stuffs.details.mesh->pos.z), |
672 | evas_canvas3d_node_orientation_set(stuffs->stuffs.details.mesh->rot.x, stuffs->stuffs.details.mesh->rot.y, stuffs->stuffs.details.mesh->rot.z, stuffs->stuffs.details.mesh->rot.w), | 673 | evas_canvas3d_node_orientation_set(stuffs->stuffs.details.mesh->rot.x, stuffs->stuffs.details.mesh->rot.y, stuffs->stuffs.details.mesh->rot.z, stuffs->stuffs.details.mesh->rot.w), |
674 | evas_canvas3d_node_scale_set(stuffs->stuffs.details.mesh->size.x, stuffs->stuffs.details.mesh->size.y, stuffs->stuffs.details.mesh->size.z), | ||
673 | evas_canvas3d_node_mesh_add(me) | 675 | evas_canvas3d_node_mesh_add(me) |
674 | ); | 676 | ); |
675 | 677 | ||
@@ -686,7 +688,7 @@ void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake) | |||
686 | } | 688 | } |
687 | 689 | ||
688 | ExtantzStuffs *addStuffs(char *uuid, char *name, char *description, char *owner, | 690 | ExtantzStuffs *addStuffs(char *uuid, char *name, char *description, char *owner, |
689 | char *file, MeshType type, double px, double py, double pz, double rx, double ry, double rz, double rw) | 691 | char *file, MeshType type, double px, double py, double pz, double rx, double ry, double rz, double rw, double sx, double sy, double sz) |
690 | { | 692 | { |
691 | ExtantzStuffs *result = calloc(1, sizeof(ExtantzStuffs)); | 693 | ExtantzStuffs *result = calloc(1, sizeof(ExtantzStuffs)); |
692 | 694 | ||
@@ -710,6 +712,7 @@ ExtantzStuffs *addStuffs(char *uuid, char *name, char *description, char *owner, | |||
710 | result->stuffs.details.mesh->type = type; | 712 | result->stuffs.details.mesh->type = type; |
711 | result->stuffs.details.mesh->pos.x = px; result->stuffs.details.mesh->pos.y = py; result->stuffs.details.mesh->pos.z = pz; | 713 | result->stuffs.details.mesh->pos.x = px; result->stuffs.details.mesh->pos.y = py; result->stuffs.details.mesh->pos.z = pz; |
712 | result->stuffs.details.mesh->rot.x = rx; result->stuffs.details.mesh->rot.y = ry; result->stuffs.details.mesh->rot.z = rz; result->stuffs.details.mesh->rot.w = rw; | 714 | result->stuffs.details.mesh->rot.x = rx; result->stuffs.details.mesh->rot.y = ry; result->stuffs.details.mesh->rot.z = rz; result->stuffs.details.mesh->rot.w = rw; |
715 | result->stuffs.details.mesh->size.x = sx; result->stuffs.details.mesh->size.y = sy; result->stuffs.details.mesh->size.z = sz; | ||
713 | result->stage = ES_NORMAL; | 716 | result->stage = ES_NORMAL; |
714 | 717 | ||
715 | return result; | 718 | return result; |