diff options
Diffstat (limited to '')
-rw-r--r-- | src/extantz/scenri.c | 23 | ||||
-rw-r--r-- | src/libraries/love.h | 3 |
2 files changed, 23 insertions, 3 deletions
diff --git a/src/extantz/scenri.c b/src/extantz/scenri.c index 1f51687..912aad9 100644 --- a/src/extantz/scenri.c +++ b/src/extantz/scenri.c | |||
@@ -421,7 +421,6 @@ Scene_Data *scenriAdd(Evas_Object *win) | |||
421 | evas_object_event_callback_add(scene->image, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, scene); | 421 | evas_object_event_callback_add(scene->image, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, scene); |
422 | #endif | 422 | #endif |
423 | 423 | ||
424 | |||
425 | elm_win_resize_object_add(win, scene->image); | 424 | elm_win_resize_object_add(win, scene->image); |
426 | 425 | ||
427 | scene->L = luaL_newstate(); | 426 | scene->L = luaL_newstate(); |
@@ -472,7 +471,7 @@ Scene_Data *scenriAdd(Evas_Object *win) | |||
472 | "userdata,number", 0); | 471 | "userdata,number", 0); |
473 | 472 | ||
474 | // Pass the enums to scenriLua. | 473 | // Pass the enums to scenriLua. |
475 | sprintf(buf, "MeshType = {cube = %d, mesh = %d, sphere = %d}", MT_CUBE, MT_MESH, MT_SPHERE); | 474 | sprintf(buf, "MeshType = {cube = %d, mesh = %d, sphere = %d, terrain = %d}", MT_CUBE, MT_MESH, MT_SPHERE, MT_TERRAIN); |
476 | doLuaString(scene->L, buf, "scenriLua"); | 475 | doLuaString(scene->L, buf, "scenriLua"); |
477 | sprintf(buf, "TextureType = {face = %d, normal = %d}", TT_FACE, TT_NORMAL); | 476 | sprintf(buf, "TextureType = {face = %d, normal = %d}", TT_FACE, TT_NORMAL); |
478 | doLuaString(scene->L, buf, "scenriLua"); | 477 | doLuaString(scene->L, buf, "scenriLua"); |
@@ -616,6 +615,7 @@ void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake) | |||
616 | 615 | ||
617 | // Meshes | 616 | // Meshes |
618 | // TODO - Write real generic cube and sphere stuff later. | 617 | // TODO - Write real generic cube and sphere stuff later. |
618 | // This could be a switch. | ||
619 | if (MT_CUBE == stuffs->stuffs.details.mesh->type) | 619 | if (MT_CUBE == stuffs->stuffs.details.mesh->type) |
620 | { | 620 | { |
621 | Eo *cube; | 621 | Eo *cube; |
@@ -654,6 +654,23 @@ void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake) | |||
654 | ); | 654 | ); |
655 | eina_array_push(stuffs->mesh, me); | 655 | eina_array_push(stuffs->mesh, me); |
656 | } | 656 | } |
657 | else if (MT_TERRAIN == stuffs->stuffs.details.mesh->type) | ||
658 | { | ||
659 | Eo *terrain; | ||
660 | |||
661 | eina_accessor_data_get(stuffs->aMaterial, 0, (void **) &mi); | ||
662 | |||
663 | terrain = eo_add(EVAS_CANVAS3D_PRIMITIVE_CLASS, scene->evas); | ||
664 | eo_do(terrain, evas_canvas3d_primitive_form_set(EVAS_CANVAS3D_MESH_PRIMITIVE_TERRAIN)); | ||
665 | |||
666 | me = eo_add(EVAS_CANVAS3D_MESH_CLASS, scene->evas, | ||
667 | evas_canvas3d_mesh_from_primitive_set(0, terrain), | ||
668 | evas_canvas3d_mesh_frame_material_set(0, mi), | ||
669 | |||
670 | evas_canvas3d_mesh_shade_mode_set(EVAS_CANVAS3D_SHADE_MODE_DIFFUSE) | ||
671 | ); | ||
672 | eina_array_push(stuffs->mesh, me); | ||
673 | } | ||
657 | else | 674 | else |
658 | { | 675 | { |
659 | eina_accessor_data_get(stuffs->aMaterial, 0, (void **) &mi); | 676 | eina_accessor_data_get(stuffs->aMaterial, 0, (void **) &mi); |
@@ -684,6 +701,8 @@ void stuffsSetup(ExtantzStuffs *stuffs, Scene_Data *scene, int fake) | |||
684 | stuffs->animateStuffs = (aniStuffs) _animateSphere; | 701 | stuffs->animateStuffs = (aniStuffs) _animateSphere; |
685 | else if (3 == fake) | 702 | else if (3 == fake) |
686 | stuffs->animateStuffs = (aniStuffs) _animateSonic; | 703 | stuffs->animateStuffs = (aniStuffs) _animateSonic; |
704 | // else if (4 == fake) | ||
705 | // stuffs->animateStuffs = (aniStuffs) _animateSphere; | ||
687 | 706 | ||
688 | } | 707 | } |
689 | 708 | ||
diff --git a/src/libraries/love.h b/src/libraries/love.h index 1e756f8..0fe6d31 100644 --- a/src/libraries/love.h +++ b/src/libraries/love.h | |||
@@ -116,7 +116,8 @@ typedef enum | |||
116 | { | 116 | { |
117 | MT_CUBE, | 117 | MT_CUBE, |
118 | MT_MESH, | 118 | MT_MESH, |
119 | MT_SPHERE | 119 | MT_SPHERE, |
120 | MT_TERRAIN | ||
120 | } MeshType; | 121 | } MeshType; |
121 | 122 | ||
122 | 123 | ||