diff options
author | David Walter Seikel | 2015-03-22 18:38:59 +1000 |
---|---|---|
committer | David Walter Seikel | 2015-03-22 18:38:59 +1000 |
commit | 4e555166e0d6cb094ce4f97ed6bfd7bec28d2a45 (patch) | |
tree | f840a48f52fcfb5bede8a7940c483bc75e9eebde /src/extantz | |
parent | We don't need no stinkin' eo_unrefs. Anymore. Though leave them there, in c... (diff) | |
download | SledjHamr-4e555166e0d6cb094ce4f97ed6bfd7bec28d2a45.zip SledjHamr-4e555166e0d6cb094ce4f97ed6bfd7bec28d2a45.tar.gz SledjHamr-4e555166e0d6cb094ce4f97ed6bfd7bec28d2a45.tar.bz2 SledjHamr-4e555166e0d6cb094ce4f97ed6bfd7bec28d2a45.tar.xz |
Allow dropping the Evas_3D stuff out of the compile.
Diffstat (limited to 'src/extantz')
-rw-r--r-- | src/extantz/extantz.c | 14 | ||||
-rw-r--r-- | src/extantz/extantz.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index 4a40137..af8fe1c 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c | |||
@@ -4,8 +4,10 @@ | |||
4 | #include "SledjHamr.h" | 4 | #include "SledjHamr.h" |
5 | 5 | ||
6 | 6 | ||
7 | #if USE_EVAS_3D | ||
7 | static void _onWorldClick(void *data, Evas *e EINA_UNUSED, Evas_Object *o, void *einfo); | 8 | static void _onWorldClick(void *data, Evas *e EINA_UNUSED, Evas_Object *o, void *einfo); |
8 | static void on_pixels(void *data, Evas_Object *obj); | 9 | static void on_pixels(void *data, Evas_Object *obj); |
10 | #endif | ||
9 | 11 | ||
10 | 12 | ||
11 | int logDom = -1; // Our logging domain. | 13 | int logDom = -1; // Our logging domain. |
@@ -89,12 +91,15 @@ static Eina_Bool _data(void *data, int type, Ecore_Con_Event_Server_Data *ev) | |||
89 | } | 91 | } |
90 | else if (0 == strncmp(command, "loadSim(", 8)) | 92 | else if (0 == strncmp(command, "loadSim(", 8)) |
91 | { | 93 | { |
94 | #if USE_EVAS_3D | ||
92 | char *p, *t; | 95 | char *p, *t; |
93 | int scenriLua; | 96 | int scenriLua; |
97 | #endif | ||
94 | 98 | ||
95 | // Pretend we logged in. Actually in the case of a local love server, we realy have logged in now. | 99 | // Pretend we logged in. Actually in the case of a local love server, we realy have logged in now. |
96 | strcpy(ourGlobals->uuid, SID); | 100 | strcpy(ourGlobals->uuid, SID); |
97 | PI("Your UUID is %s.", ourGlobals->uuid); | 101 | PI("Your UUID is %s.", ourGlobals->uuid); |
102 | #if USE_EVAS_3D | ||
98 | strcpy(buf, &command[8]); | 103 | strcpy(buf, &command[8]); |
99 | p = buf; | 104 | p = buf; |
100 | while ('"' == p[0]) | 105 | while ('"' == p[0]) |
@@ -121,6 +126,7 @@ static Eina_Bool _data(void *data, int type, Ecore_Con_Event_Server_Data *ev) | |||
121 | 126 | ||
122 | push_lua(ourGlobals->scene->L, "@ ( $ )", scenriLua, "loadSim", t, 0); | 127 | push_lua(ourGlobals->scene->L, "@ ( $ )", scenriLua, "loadSim", t, 0); |
123 | PI("Loaded local sim from %s", t); | 128 | PI("Loaded local sim from %s", t); |
129 | #endif | ||
124 | } | 130 | } |
125 | else | 131 | else |
126 | { | 132 | { |
@@ -161,6 +167,7 @@ static Eina_Bool _del(void *data, int type, Ecore_Con_Event_Server_Del *ev) | |||
161 | return ECORE_CALLBACK_CANCEL; | 167 | return ECORE_CALLBACK_CANCEL; |
162 | } | 168 | } |
163 | 169 | ||
170 | #if USE_EVAS_3D | ||
164 | static void _onWorldClick(void *data, Evas *e EINA_UNUSED, Evas_Object *o, void *einfo) | 171 | static void _onWorldClick(void *data, Evas *e EINA_UNUSED, Evas_Object *o, void *einfo) |
165 | { | 172 | { |
166 | Evas_3D_Node *n = data; | 173 | Evas_3D_Node *n = data; |
@@ -181,6 +188,7 @@ static void _onWorldClick(void *data, Evas *e EINA_UNUSED, Evas_Object *o, void | |||
181 | } | 188 | } |
182 | } | 189 | } |
183 | } | 190 | } |
191 | #endif | ||
184 | 192 | ||
185 | static void gldata_init(GLData *gld) | 193 | static void gldata_init(GLData *gld) |
186 | { | 194 | { |
@@ -369,10 +377,12 @@ static void _draw_gl(Evas_Object *obj) | |||
369 | gld->resized = 0; | 377 | gld->resized = 0; |
370 | } | 378 | } |
371 | 379 | ||
380 | #if USE_EVAS_3D | ||
372 | static void on_pixels(void *data, Evas_Object *obj) | 381 | static void on_pixels(void *data, Evas_Object *obj) |
373 | { | 382 | { |
374 | _draw_gl(obj); | 383 | _draw_gl(obj); |
375 | } | 384 | } |
385 | #endif | ||
376 | 386 | ||
377 | // Callback from the animator. | 387 | // Callback from the animator. |
378 | static Eina_Bool doFrame(void *data) | 388 | static Eina_Bool doFrame(void *data) |
@@ -688,6 +698,7 @@ EAPI_MAIN int elm_main(int argc, char **argv) | |||
688 | 698 | ||
689 | init_evas_gl(&ourGlobals); | 699 | init_evas_gl(&ourGlobals); |
690 | 700 | ||
701 | #if USE_EVAS_3D | ||
691 | // Setup our Evas_3D stuff. | 702 | // Setup our Evas_3D stuff. |
692 | ourGlobals.scene = scenriAdd(ourGlobals.win); | 703 | ourGlobals.scene = scenriAdd(ourGlobals.win); |
693 | // TODO - Just a temporary hack so Irrlicht and Evas_3D can share the camera move. | 704 | // TODO - Just a temporary hack so Irrlicht and Evas_3D can share the camera move. |
@@ -695,6 +706,7 @@ EAPI_MAIN int elm_main(int argc, char **argv) | |||
695 | evas_object_data_set(elm_image_object_get(ourGlobals.scene->image), "glob", &ourGlobals); | 706 | evas_object_data_set(elm_image_object_get(ourGlobals.scene->image), "glob", &ourGlobals); |
696 | evas_object_image_pixels_get_callback_set(elm_image_object_get(ourGlobals.scene->image), on_pixels, &ourGlobals); | 707 | evas_object_image_pixels_get_callback_set(elm_image_object_get(ourGlobals.scene->image), on_pixels, &ourGlobals); |
697 | ourGlobals.scene->clickCb = _onWorldClick; | 708 | ourGlobals.scene->clickCb = _onWorldClick; |
709 | #endif | ||
698 | 710 | ||
699 | // Gotta do this after adding the windows, otherwise the menu renders under the window. | 711 | // Gotta do this after adding the windows, otherwise the menu renders under the window. |
700 | // This sucks, gotta redefine this menu each time we create a new window? | 712 | // This sucks, gotta redefine this menu each time we create a new window? |
@@ -730,8 +742,10 @@ EAPI_MAIN int elm_main(int argc, char **argv) | |||
730 | if (ourGlobals.win) | 742 | if (ourGlobals.win) |
731 | { | 743 | { |
732 | ecore_animator_del(ourGlobals.animator); | 744 | ecore_animator_del(ourGlobals.animator); |
745 | #if USE_EVAS_3D | ||
733 | Evas_3D_Demo_fini(&ourGlobals); | 746 | Evas_3D_Demo_fini(&ourGlobals); |
734 | scenriDel(ourGlobals.scene); | 747 | scenriDel(ourGlobals.scene); |
748 | #endif | ||
735 | // eo_unref(ourGlobals.tb); | 749 | // eo_unref(ourGlobals.tb); |
736 | winFangDel(ourGlobals.mainWindow); | 750 | winFangDel(ourGlobals.mainWindow); |
737 | } | 751 | } |
diff --git a/src/extantz/extantz.h b/src/extantz/extantz.h index 5882e10..c6b9630 100644 --- a/src/extantz/extantz.h +++ b/src/extantz/extantz.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _EXTANTZ_H_ | 1 | #ifndef _EXTANTZ_H_ |
2 | #define _EXTANTZ_H_ | 2 | #define _EXTANTZ_H_ |
3 | 3 | ||
4 | #define USE_EVAS_3D 1 | ||
4 | #define USE_IRR 0 | 5 | #define USE_IRR 0 |
5 | #define USE_DEMO 1 | 6 | #define USE_DEMO 1 |
6 | #define DO_GEARS 0 | 7 | #define DO_GEARS 0 |