aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/extantz
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-20 23:34:25 +1000
committerDavid Walter Seikel2014-05-20 23:34:25 +1000
commit909fd6e2c4369020707782e20656069fbb3030d1 (patch)
tree15590f94950be42916fff1b3ba00124bce157751 /src/extantz
parentThe results of a session with valgrind. (diff)
downloadSledjHamr-909fd6e2c4369020707782e20656069fbb3030d1.zip
SledjHamr-909fd6e2c4369020707782e20656069fbb3030d1.tar.gz
SledjHamr-909fd6e2c4369020707782e20656069fbb3030d1.tar.bz2
SledjHamr-909fd6e2c4369020707782e20656069fbb3030d1.tar.xz
Found a way to deal with the PACKAGE_* stuff outside of Elm. It's undocumented.
Diffstat (limited to 'src/extantz')
-rw-r--r--src/extantz/Evas_3D_demo.c8
-rw-r--r--src/extantz/ephysics_demo.c4
-rw-r--r--src/extantz/extantz.c27
-rw-r--r--src/extantz/extantz.h1
-rw-r--r--src/extantz/woMan.c6
5 files changed, 19 insertions, 27 deletions
diff --git a/src/extantz/Evas_3D_demo.c b/src/extantz/Evas_3D_demo.c
index 3dda9ef..6cb673b 100644
--- a/src/extantz/Evas_3D_demo.c
+++ b/src/extantz/Evas_3D_demo.c
@@ -286,7 +286,7 @@ static void _cube_setup(globals *ourGlobals, Scene_Data *scene)
286 evas_3d_texture_data_set(EVAS_3D_COLOR_FORMAT_RGBA, EVAS_3D_PIXEL_FORMAT_8888, 4, 4, &pixels1[0]) 286 evas_3d_texture_data_set(EVAS_3D_COLOR_FORMAT_RGBA, EVAS_3D_PIXEL_FORMAT_8888, 4, 4, &pixels1[0])
287 ); 287 );
288 288
289 snprintf(buf, sizeof(buf), "%s/normal_lego.png", elm_app_data_dir_get()); 289 snprintf(buf, sizeof(buf), "%s/normal_lego.png", prefix_data_get());
290 scene->texture_normal = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas, 290 scene->texture_normal = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas,
291 evas_3d_texture_file_set(buf, NULL) 291 evas_3d_texture_file_set(buf, NULL)
292 ); 292 );
@@ -354,7 +354,7 @@ static void _sonic_setup(globals *ourGlobals, Scene_Data *scene)
354 char buf[PATH_MAX]; 354 char buf[PATH_MAX];
355 355
356 // Setup an MD2 mesh. 356 // Setup an MD2 mesh.
357 snprintf(buf, sizeof(buf), "%s/sonic.png", elm_app_data_dir_get()); 357 snprintf(buf, sizeof(buf), "%s/sonic.png", prefix_data_get());
358 scene->texture2 = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas, 358 scene->texture2 = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas,
359 evas_3d_texture_file_set(buf, NULL), 359 evas_3d_texture_file_set(buf, NULL),
360 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST, EVAS_3D_TEXTURE_FILTER_NEAREST), 360 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_NEAREST, EVAS_3D_TEXTURE_FILTER_NEAREST),
@@ -375,7 +375,7 @@ static void _sonic_setup(globals *ourGlobals, Scene_Data *scene)
375 evas_3d_material_shininess_set(50.0) 375 evas_3d_material_shininess_set(50.0)
376 ); 376 );
377 377
378 snprintf(buf, sizeof(buf), "%s/sonic.md2", elm_app_data_dir_get()); 378 snprintf(buf, sizeof(buf), "%s/sonic.md2", prefix_data_get());
379 scene->mesh2 = eo_add(EVAS_3D_MESH_CLASS, ourGlobals->evas, 379 scene->mesh2 = eo_add(EVAS_3D_MESH_CLASS, ourGlobals->evas,
380 evas_3d_mesh_file_set(EVAS_3D_MESH_FILE_TYPE_MD2, buf, NULL), 380 evas_3d_mesh_file_set(EVAS_3D_MESH_FILE_TYPE_MD2, buf, NULL),
381 evas_3d_mesh_frame_material_set(0, scene->material2), 381 evas_3d_mesh_frame_material_set(0, scene->material2),
@@ -397,7 +397,7 @@ static void _earth_setup(globals *ourGlobals, Scene_Data *scene)
397 char buf[PATH_MAX]; 397 char buf[PATH_MAX];
398 398
399 // Setup earth material. 399 // Setup earth material.
400 snprintf(buf, sizeof(buf), "%s/EarthDiffuse.png", elm_app_data_dir_get()); 400 snprintf(buf, sizeof(buf), "%s/EarthDiffuse.png", prefix_data_get());
401 scene->texture_diffuse = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas, 401 scene->texture_diffuse = eo_add(EVAS_3D_TEXTURE_CLASS, ourGlobals->evas,
402 evas_3d_texture_file_set(buf, NULL), 402 evas_3d_texture_file_set(buf, NULL),
403 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_LINEAR, EVAS_3D_TEXTURE_FILTER_LINEAR) 403 evas_3d_texture_filter_set(EVAS_3D_TEXTURE_FILTER_LINEAR, EVAS_3D_TEXTURE_FILTER_LINEAR)
diff --git a/src/extantz/ephysics_demo.c b/src/extantz/ephysics_demo.c
index a0bf4d0..89dda99 100644
--- a/src/extantz/ephysics_demo.c
+++ b/src/extantz/ephysics_demo.c
@@ -32,7 +32,7 @@ EPhysics_World *ephysicsAdd(globals *ourGlobals)
32 ephysics_body_restitution_set(boundary, 1); 32 ephysics_body_restitution_set(boundary, 1);
33 ephysics_body_friction_set(boundary, 0); 33 ephysics_body_friction_set(boundary, 0);
34 34
35 sprintf(buf, "%s/%s.edj", elm_app_data_dir_get(), EPHYSICS_TEST_THEME); 35 sprintf(buf, "%s/%s.edj", prefix_data_get(), EPHYSICS_TEST_THEME);
36 box1 = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals->win, 36 box1 = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals->win,
37 elm_obj_image_file_set(buf, "blue-cube"), 37 elm_obj_image_file_set(buf, "blue-cube"),
38 evas_obj_size_set(70, 70), 38 evas_obj_size_set(70, 70),
@@ -49,7 +49,7 @@ EPhysics_World *ephysicsAdd(globals *ourGlobals)
49 ephysics_body_sleeping_threshold_set(box_body1, 0.1, 0.1); 49 ephysics_body_sleeping_threshold_set(box_body1, 0.1, 0.1);
50 eo_unref(box1); 50 eo_unref(box1);
51 51
52 sprintf(buf, "%s/%s.edj", elm_app_data_dir_get(), EPHYSICS_TEST_THEME); 52 sprintf(buf, "%s/%s.edj", prefix_data_get(), EPHYSICS_TEST_THEME);
53 box2 = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals->win, 53 box2 = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals->win,
54 elm_obj_image_file_set(buf, "purple-cube"), 54 elm_obj_image_file_set(buf, "purple-cube"),
55 evas_obj_size_set(70, 70), 55 evas_obj_size_set(70, 70),
diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c
index fa38251..a27118b 100644
--- a/src/extantz/extantz.c
+++ b/src/extantz/extantz.c
@@ -2,14 +2,13 @@
2 2
3#include "extantz.h" 3#include "extantz.h"
4#include "SledjHamr.h" 4#include "SledjHamr.h"
5#include "LumbrJack.h"
6 5
7 6
8static void _onWorldClick(void *data, Evas *e EINA_UNUSED, Evas_Object *o, void *einfo); 7static void _onWorldClick(void *data, Evas *e EINA_UNUSED, Evas_Object *o, void *einfo);
9static void on_pixels(void *data, Evas_Object *obj); 8static void on_pixels(void *data, Evas_Object *obj);
10 9
11 10
12static int logDom; // Our logging domain. 11int logDom = -1; // Our logging domain.
13globals ourGlobals; 12globals ourGlobals;
14static Eina_Strbuf *serverStream; 13static Eina_Strbuf *serverStream;
15 14
@@ -120,7 +119,7 @@ static Eina_Bool _del(void *data, int type, Ecore_Con_Event_Server_Del *ev)
120 PW("Failed to connect to a world server, starting our own."); 119 PW("Failed to connect to a world server, starting our own.");
121 120
122 // TODO - Should use Ecore_Exe for this sort of thing. 121 // TODO - Should use Ecore_Exe for this sort of thing.
123 sprintf(buf, "%s/love &", elm_app_bin_dir_get()); 122 sprintf(buf, "%s/love &", prefix_bin_get());
124 system(buf); 123 system(buf);
125 count = 0; 124 count = 0;
126 } 125 }
@@ -555,6 +554,8 @@ EAPI_MAIN int elm_main(int argc, char **argv)
555 char buf[PATH_MAX * 2]; 554 char buf[PATH_MAX * 2];
556// Eina_Bool gotWebKit = elm_need_web(); // Initialise ewebkit if it exists, or return EINA_FALSE if it don't. 555// Eina_Bool gotWebKit = elm_need_web(); // Initialise ewebkit if it exists, or return EINA_FALSE if it don't.
557 556
557 logDom = HamrTime(argv[0], elm_main, logDom);
558
558 /* Set the locale according to the system pref. 559 /* Set the locale according to the system pref.
559 * If you don't do so the file selector will order the files list in 560 * If you don't do so the file selector will order the files list in
560 * a case sensitive manner 561 * a case sensitive manner
@@ -564,13 +565,6 @@ EAPI_MAIN int elm_main(int argc, char **argv)
564 elm_need_ethumb(); 565 elm_need_ethumb();
565 elm_need_efreet(); 566 elm_need_efreet();
566 567
567 HamrTime(elm_main, "extantz");
568 fprintf(stdout, "prefix was set to: %s\n", elm_app_prefix_dir_get());
569 fprintf(stdout, "data directory is: %s\n", elm_app_data_dir_get());
570 fprintf(stdout, "library directory is: %s\n", elm_app_lib_dir_get());
571 fprintf(stdout, "locale directory is: %s\n", elm_app_locale_dir_get());
572
573 logDom = loggingStartup("extantz", logDom);
574 ourGlobals.running = 1; 568 ourGlobals.running = 1;
575 569
576 570
@@ -643,7 +637,7 @@ EAPI_MAIN int elm_main(int argc, char **argv)
643 637
644 // Override the background image 638 // Override the background image
645#if 1 639#if 1
646 snprintf(buf, sizeof(buf), "%s/sky_03.jpg", elm_app_data_dir_get()); 640 snprintf(buf, sizeof(buf), "%s/sky_03.jpg", prefix_data_get());
647 ourGlobals.mainWindow->bg = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals.mainWindow->win, 641 ourGlobals.mainWindow->bg = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals.mainWindow->win,
648 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), 642 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND),
649 elm_obj_image_fill_outside_set(EINA_TRUE), 643 elm_obj_image_fill_outside_set(EINA_TRUE),
@@ -652,7 +646,7 @@ EAPI_MAIN int elm_main(int argc, char **argv)
652 ); 646 );
653 elm_win_resize_object_add(ourGlobals.mainWindow->win, ourGlobals.mainWindow->bg); 647 elm_win_resize_object_add(ourGlobals.mainWindow->win, ourGlobals.mainWindow->bg);
654#else 648#else
655 snprintf(buf, sizeof(buf), "%s/sky_03.jpg", elm_app_data_dir_get()); 649 snprintf(buf, sizeof(buf), "%s/sky_03.jpg", prefix_data_get());
656 eo_do(ourGlobals.mainWindow->bg, 650 eo_do(ourGlobals.mainWindow->bg,
657 elm_obj_image_file_set(buf, NULL), 651 elm_obj_image_file_set(buf, NULL),
658 evas_obj_color_set(255, 255, 255, 255) 652 evas_obj_color_set(255, 255, 255, 255)
@@ -673,7 +667,7 @@ EAPI_MAIN int elm_main(int argc, char **argv)
673 woMan_add(&ourGlobals); 667 woMan_add(&ourGlobals);
674 ourGlobals.purkle = GuiLuaLoad("purkle", ourGlobals.mainWindow, ourGlobals.world); 668 ourGlobals.purkle = GuiLuaLoad("purkle", ourGlobals.mainWindow, ourGlobals.world);
675 ourGlobals.LSLGuiMess = GuiLuaLoad("LSLGuiMess", ourGlobals.mainWindow, ourGlobals.world); 669 ourGlobals.LSLGuiMess = GuiLuaLoad("LSLGuiMess", ourGlobals.mainWindow, ourGlobals.world);
676 ourGlobals.files = filesAdd(&ourGlobals, (char *) elm_app_data_dir_get(), EINA_TRUE, EINA_FALSE); 670 ourGlobals.files = filesAdd(&ourGlobals, (char *) prefix_data_get(), EINA_TRUE, EINA_FALSE);
677 671
678 // Try to connect to the love server we started before. 672 // Try to connect to the love server we started before.
679 serverStream = eina_strbuf_new(); 673 serverStream = eina_strbuf_new();
@@ -701,11 +695,8 @@ EAPI_MAIN int elm_main(int argc, char **argv)
701 winFangDel(ourGlobals.mainWindow); 695 winFangDel(ourGlobals.mainWindow);
702 } 696 }
703 697
704 if (logDom >= 0) 698 pantsOff(logDom);
705 { 699 logDom = -1;
706 eina_log_domain_unregister(logDom);
707 logDom = -1;
708 }
709 700
710 elm_shutdown(); 701 elm_shutdown();
711 702
diff --git a/src/extantz/extantz.h b/src/extantz/extantz.h
index a41f4e0..ca62bdc 100644
--- a/src/extantz/extantz.h
+++ b/src/extantz/extantz.h
@@ -6,6 +6,7 @@
6#define DO_GEARS 0 6#define DO_GEARS 0
7 7
8 8
9#include "LumbrJack.h"
9#include "winFang.h" 10#include "winFang.h"
10#include "GuiLua.h" 11#include "GuiLua.h"
11#include "scenri.h" 12#include "scenri.h"
diff --git a/src/extantz/woMan.c b/src/extantz/woMan.c
index ef10631..09e7e2d 100644
--- a/src/extantz/woMan.c
+++ b/src/extantz/woMan.c
@@ -35,8 +35,8 @@ static Elm_Genlist_Item_Class *grid_gic = NULL;
35static Elm_Genlist_Item_Class *account_gic = NULL; 35static Elm_Genlist_Item_Class *account_gic = NULL;
36static Elm_Genlist_Item_Class *viewer_gic = NULL; 36static Elm_Genlist_Item_Class *viewer_gic = NULL;
37 37
38//static const char *img1 = PACKAGE_DATA_DIR "plant_01.jpg"; 38//static const char *img1 = "plant_01.jpg";
39//static const char *img2 = PACKAGE_DATA_DIR "sky_01.jpg"; 39//static const char *img2 = "sky_01.jpg";
40static const char *img3 = "rock_01.jpg"; 40static const char *img3 = "rock_01.jpg";
41 41
42 42
@@ -264,7 +264,7 @@ winFang *woMan_add(globals *ourGlobals)
264 evas_object_size_hint_align_set(nf, EVAS_HINT_FILL, EVAS_HINT_FILL); 264 evas_object_size_hint_align_set(nf, EVAS_HINT_FILL, EVAS_HINT_FILL);
265 evas_object_show(nf); 265 evas_object_show(nf);
266 266
267 sprintf(buf, "%s/%s", elm_app_data_dir_get(), img3); 267 sprintf(buf, "%s/%s", prefix_data_get(), img3);
268 tab = viewerList; tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Viewers", _promote, tab_it); 268 tab = viewerList; tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Viewers", _promote, tab_it);
269 // TODO - This strdup leaks, but this is just temporary test code anyway, it will go away. 269 // TODO - This strdup leaks, but this is just temporary test code anyway, it will go away.
270 tab = _content_image_new(me->win, strdup(buf)); tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Landmarks", _promote, tab_it); 270 tab = _content_image_new(me->win, strdup(buf)); tab_it = elm_naviframe_item_push(nf, NULL, NULL, NULL, tab, NULL); elm_naviframe_item_title_enabled_set(tab_it, EINA_FALSE, EINA_TRUE); elm_toolbar_item_append(tb, NULL, "Landmarks", _promote, tab_it);