aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/love
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/love
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/love')
-rwxr-xr-xsrc/love/build.lua6
-rw-r--r--src/love/love.c17
2 files changed, 9 insertions, 14 deletions
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'})
18 18
19runCommand('edje_cc', dir, 'edje_cc ' .. EDJE_FLAGS .. ' love.edc ../../media/love.edj') 19runCommand('edje_cc', dir, 'edje_cc ' .. EDJE_FLAGS .. ' love.edc ../../media/love.edj')
20 20
21-- While SledHamr.c does this, we can't use that here, coz love is not an Elm app.
22CFLAGS = CFLAGS .. ' -DPACKAGE_BIN_DIR=\\"' .. bin_d .. '\\"'
23CFLAGS = CFLAGS .. ' -DPACKAGE_LIB_DIR=\\"' .. lib_d .. '\\"'
24CFLAGS = CFLAGS .. ' -DPACKAGE_DATA_DIR=\\"' .. data_d .. '\\"'
25CFLAGS = CFLAGS .. ' -DPACKAGE_LOCALE_DIR=\\"' .. locale_d .. '\\"'
26
27compileFiles('../../love', dir, {'love'}, '') 21compileFiles('../../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
55} script; 55} script;
56 56
57 57
58int logDom; // Our logging domain. 58int logDom = -1; // Our logging domain.
59//static int CPUs = 4; 59//static int CPUs = 4;
60static Eina_Strbuf *LuaSLStream; 60static Eina_Strbuf *LuaSLStream;
61static Eina_Strbuf *clientStream; 61static Eina_Strbuf *clientStream;
@@ -166,7 +166,7 @@ static Eina_Bool _addLuaSL(void *data, int type, Ecore_Con_Event_Server_Add *ev)
166 166
167 // Compile and run scripts. 167 // Compile and run scripts.
168 gettimeofday(&startTime, NULL); 168 gettimeofday(&startTime, NULL);
169 snprintf(buf, sizeof(buf), "%s/Test sim/objects", PACKAGE_DATA_DIR); 169 snprintf(buf, sizeof(buf), "%s/Test sim/objects", prefix_data_get());
170 eina_file_dir_list(buf, EINA_TRUE, dirList_compile, data); 170 eina_file_dir_list(buf, EINA_TRUE, dirList_compile, data);
171 171
172 return ECORE_CALLBACK_RENEW; 172 return ECORE_CALLBACK_RENEW;
@@ -413,7 +413,7 @@ static Eina_Bool _dataLuaSL(void *data, int type, Ecore_Con_Event_Server_Data *e
413 temp++; 413 temp++;
414 temp[0] = '\0'; 414 temp[0] = '\0';
415 lineNo = atoi(line); 415 lineNo = atoi(line);
416 snprintf(key, sizeof(key), "%s/Test sim/objects/onefang%%27s%%20test%%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/%s", PACKAGE_DATA_DIR, notecard); 416 snprintf(key, sizeof(key), "%s/Test sim/objects/onefang%%27s%%20test%%20bed.5cb927d5-1304-4f1a-9947-308251ef2df0/%s", prefix_data_get(), notecard);
417 417
418 fd = open(key, O_RDONLY); 418 fd = open(key, O_RDONLY);
419 if (-1 != fd) 419 if (-1 != fd)
@@ -493,7 +493,7 @@ static Eina_Bool _delLuaSL(void *data, int type, Ecore_Con_Event_Server_Del *ev)
493 char buf[PATH_MAX]; 493 char buf[PATH_MAX];
494 494
495 PW("Failed to connect to a script server, starting our own."); 495 PW("Failed to connect to a script server, starting our own.");
496 sprintf(buf, "%s/LuaSL &", PACKAGE_BIN_DIR); 496 sprintf(buf, "%s/LuaSL &", prefix_bin_get());
497 system(buf); 497 system(buf);
498 count = 0; 498 count = 0;
499 } 499 }
@@ -618,7 +618,7 @@ int main(int argc, char **argv)
618 618
619 if (eina_init()) 619 if (eina_init())
620 { 620 {
621 logDom = loggingStartup("love", logDom); 621 logDom = HamrTime(argv[0], main, logDom);
622 ourGlobals.scripts = eina_hash_string_superfast_new(NULL); 622 ourGlobals.scripts = eina_hash_string_superfast_new(NULL);
623 623
624 if (ecore_con_init()) 624 if (ecore_con_init())
@@ -703,7 +703,7 @@ int main(int argc, char **argv)
703 evas_object_focus_set(ourGlobals.bg, EINA_TRUE); 703 evas_object_focus_set(ourGlobals.bg, EINA_TRUE);
704 704
705 ourGlobals.edje = edje_object_add(ourGlobals.canvas); 705 ourGlobals.edje = edje_object_add(ourGlobals.canvas);
706 snprintf(buf, sizeof(buf), "%s/%s.edj", PACKAGE_DATA_DIR, "love"); 706 snprintf(buf, sizeof(buf), "%s/%s.edj", prefix_data_get(), "love");
707 if (!edje_object_file_set(ourGlobals.edje, buf, group)) 707 if (!edje_object_file_set(ourGlobals.edje, buf, group))
708 { 708 {
709 int err = edje_object_load_error_get(ourGlobals.edje); 709 int err = edje_object_load_error_get(ourGlobals.edje);
@@ -720,7 +720,7 @@ int main(int argc, char **argv)
720 evas_object_resize(ourGlobals.edje, WIDTH, HEIGHT); 720 evas_object_resize(ourGlobals.edje, WIDTH, HEIGHT);
721 evas_object_show(ourGlobals.edje); 721 evas_object_show(ourGlobals.edje);
722 722
723 snprintf(buf, sizeof(buf), "%s/bubble_sh.png", PACKAGE_DATA_DIR); 723 snprintf(buf, sizeof(buf), "%s/bubble_sh.png", prefix_data_get());
724 for (i = 0; i < (sizeof(names) / sizeof(char *) / 2); i++) 724 for (i = 0; i < (sizeof(names) / sizeof(char *) / 2); i++)
725 { 725 {
726 sh = evas_object_image_filled_add(ourGlobals.canvas); 726 sh = evas_object_image_filled_add(ourGlobals.canvas);
@@ -730,7 +730,7 @@ int main(int argc, char **argv)
730 evas_object_data_set(ourGlobals.bg, names[(i * 2) + 1], sh); 730 evas_object_data_set(ourGlobals.bg, names[(i * 2) + 1], sh);
731 } 731 }
732 732
733 snprintf(buf, sizeof(buf), "%s/bubble.png", PACKAGE_DATA_DIR); 733 snprintf(buf, sizeof(buf), "%s/bubble.png", prefix_data_get());
734 for (i = 0; i < (sizeof(names) / sizeof(char *) / 2); i++) 734 for (i = 0; i < (sizeof(names) / sizeof(char *) / 2); i++)
735 { 735 {
736 bub = evas_object_image_filled_add(ourGlobals.canvas); 736 bub = evas_object_image_filled_add(ourGlobals.canvas);
@@ -779,6 +779,7 @@ int main(int argc, char **argv)
779 PC("Failed to init ecore_con!"); 779 PC("Failed to init ecore_con!");
780 780
781 eina_hash_free(ourGlobals.scripts); 781 eina_hash_free(ourGlobals.scripts);
782 pantsOff(logDom);
782 } 783 }
783 else 784 else
784 fprintf(stderr, "Failed to init eina!"); 785 fprintf(stderr, "Failed to init eina!");