From 909fd6e2c4369020707782e20656069fbb3030d1 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 20 May 2014 23:34:25 +1000 Subject: Found a way to deal with the PACKAGE_* stuff outside of Elm. It's undocumented. --- src/love/build.lua | 6 ------ src/love/love.c | 17 +++++++++-------- 2 files changed, 9 insertions(+), 14 deletions(-) (limited to 'src/love') diff --git a/src/love/build.lua b/src/love/build.lua index f4ae37f..5ecca31 100755 --- a/src/love/build.lua +++ b/src/love/build.lua @@ -18,10 +18,4 @@ removeFiles(dir, {'../../love', '*.o', '../../media/love.edj'}) runCommand('edje_cc', dir, 'edje_cc ' .. EDJE_FLAGS .. ' love.edc ../../media/love.edj') --- While SledHamr.c does this, we can't use that here, coz love is not an Elm app. -CFLAGS = CFLAGS .. ' -DPACKAGE_BIN_DIR=\\"' .. bin_d .. '\\"' -CFLAGS = CFLAGS .. ' -DPACKAGE_LIB_DIR=\\"' .. lib_d .. '\\"' -CFLAGS = CFLAGS .. ' -DPACKAGE_DATA_DIR=\\"' .. data_d .. '\\"' -CFLAGS = CFLAGS .. ' -DPACKAGE_LOCALE_DIR=\\"' .. locale_d .. '\\"' - compileFiles('../../love', dir, {'love'}, '') diff --git a/src/love/love.c b/src/love/love.c index 0e4ac40..1f885bc 100644 --- a/src/love/love.c +++ b/src/love/love.c @@ -55,7 +55,7 @@ typedef struct _script } script; -int logDom; // Our logging domain. +int logDom = -1; // Our logging domain. //static int CPUs = 4; static Eina_Strbuf *LuaSLStream; static Eina_Strbuf *clientStream; @@ -166,7 +166,7 @@ static Eina_Bool _addLuaSL(void *data, int type, Ecore_Con_Event_Server_Add *ev) // Compile and run scripts. gettimeofday(&startTime, NULL); - snprintf(buf, sizeof(buf), "%s/Test sim/objects", PACKAGE_DATA_DIR); + snprintf(buf, sizeof(buf), "%s/Test sim/objects", prefix_data_get()); eina_file_dir_list(buf, EINA_TRUE, dirList_compile, data); return ECORE_CALLBACK_RENEW; @@ -413,7 +413,7 @@ static Eina_Bool _dataLuaSL(void *data, int type, Ecore_Con_Event_Server_Data *e temp++; temp[0] = '\0'; lineNo = atoi(line); - snprintf(key, sizeof(key), "%s/Test sim/objects/onefang%%27s%%20test%%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/%s", PACKAGE_DATA_DIR, notecard); + snprintf(key, sizeof(key), "%s/Test sim/objects/onefang%%27s%%20test%%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/%s", prefix_data_get(), notecard); fd = open(key, O_RDONLY); if (-1 != fd) @@ -493,7 +493,7 @@ static Eina_Bool _delLuaSL(void *data, int type, Ecore_Con_Event_Server_Del *ev) char buf[PATH_MAX]; PW("Failed to connect to a script server, starting our own."); - sprintf(buf, "%s/LuaSL &", PACKAGE_BIN_DIR); + sprintf(buf, "%s/LuaSL &", prefix_bin_get()); system(buf); count = 0; } @@ -618,7 +618,7 @@ int main(int argc, char **argv) if (eina_init()) { - logDom = loggingStartup("love", logDom); + logDom = HamrTime(argv[0], main, logDom); ourGlobals.scripts = eina_hash_string_superfast_new(NULL); if (ecore_con_init()) @@ -703,7 +703,7 @@ int main(int argc, char **argv) evas_object_focus_set(ourGlobals.bg, EINA_TRUE); ourGlobals.edje = edje_object_add(ourGlobals.canvas); - snprintf(buf, sizeof(buf), "%s/%s.edj", PACKAGE_DATA_DIR, "love"); + snprintf(buf, sizeof(buf), "%s/%s.edj", prefix_data_get(), "love"); if (!edje_object_file_set(ourGlobals.edje, buf, group)) { int err = edje_object_load_error_get(ourGlobals.edje); @@ -720,7 +720,7 @@ int main(int argc, char **argv) evas_object_resize(ourGlobals.edje, WIDTH, HEIGHT); evas_object_show(ourGlobals.edje); - snprintf(buf, sizeof(buf), "%s/bubble_sh.png", PACKAGE_DATA_DIR); + snprintf(buf, sizeof(buf), "%s/bubble_sh.png", prefix_data_get()); for (i = 0; i < (sizeof(names) / sizeof(char *) / 2); i++) { sh = evas_object_image_filled_add(ourGlobals.canvas); @@ -730,7 +730,7 @@ int main(int argc, char **argv) evas_object_data_set(ourGlobals.bg, names[(i * 2) + 1], sh); } - snprintf(buf, sizeof(buf), "%s/bubble.png", PACKAGE_DATA_DIR); + snprintf(buf, sizeof(buf), "%s/bubble.png", prefix_data_get()); for (i = 0; i < (sizeof(names) / sizeof(char *) / 2); i++) { bub = evas_object_image_filled_add(ourGlobals.canvas); @@ -779,6 +779,7 @@ int main(int argc, char **argv) PC("Failed to init ecore_con!"); eina_hash_free(ourGlobals.scripts); + pantsOff(logDom); } else fprintf(stderr, "Failed to init eina!"); -- cgit v1.1