diff options
author | David Walter Seikel | 2014-05-13 14:42:20 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-13 14:42:20 +1000 |
commit | 29f3fe70aeb5f566864c7868f7c89483547e92b4 (patch) | |
tree | c142966809d5b0d67104e12c8b7ed5d61417dab8 /src | |
parent | Oops, left this laying around, no longer needed. (diff) | |
download | SledjHamr-29f3fe70aeb5f566864c7868f7c89483547e92b4.zip SledjHamr-29f3fe70aeb5f566864c7868f7c89483547e92b4.tar.gz SledjHamr-29f3fe70aeb5f566864c7868f7c89483547e92b4.tar.bz2 SledjHamr-29f3fe70aeb5f566864c7868f7c89483547e92b4.tar.xz |
Extantz calls love, and love calls LuaSL, and clean out the need for scripts to twiddle the Lua paths.
Diffstat (limited to 'src')
-rw-r--r-- | src/LuaSL/LuaSL_main.c | 19 | ||||
-rwxr-xr-x | src/LuaSL/test.sh | 27 | ||||
-rwxr-xr-x | src/extantz/build.lua | 2 | ||||
-rw-r--r-- | src/extantz/extantz.c | 19 | ||||
-rw-r--r-- | src/love/love.c | 7 |
5 files changed, 43 insertions, 31 deletions
diff --git a/src/LuaSL/LuaSL_main.c b/src/LuaSL/LuaSL_main.c index 0d8a6db..7d6fa99 100644 --- a/src/LuaSL/LuaSL_main.c +++ b/src/LuaSL/LuaSL_main.c | |||
@@ -221,8 +221,23 @@ static Eina_Bool _del(void *data, int type __UNUSED__, Ecore_Con_Event_Client_De | |||
221 | 221 | ||
222 | int main(int argc, char **argv) | 222 | int main(int argc, char **argv) |
223 | { | 223 | { |
224 | gameGlobals ourGlobals; | 224 | gameGlobals ourGlobals; |
225 | int result = EXIT_FAILURE; | 225 | char *env, cwd[PATH_MAX], temp[PATH_MAX * 2]; |
226 | int result = EXIT_FAILURE; | ||
227 | |||
228 | // Sigh, Elm has this great thing for dealing with bin, lib, and data directories, but this is not an Elm app, | ||
229 | // And Elm is too heavy for just that little bit. | ||
230 | // So just duplicate a bit of what we need here. Sorta. | ||
231 | getcwd(cwd, PATH_MAX); | ||
232 | env = getenv("LUA_CPATH"); | ||
233 | if (!env) env = ""; | ||
234 | sprintf(temp, "%s;%s/lib?.so;%s/?.so;%s/?.so", env, PACKAGE_LIB_DIR, PACKAGE_LIB_DIR, cwd); | ||
235 | setenv("LUA_CPATH", temp, 1); | ||
236 | |||
237 | env = getenv("LUA_PATH"); | ||
238 | if (!env) env = ""; | ||
239 | sprintf(temp, "%s;%s/?.lua;%s/?.lua", env, PACKAGE_LIB_DIR, cwd); | ||
240 | setenv("LUA_PATH", temp, 1); | ||
226 | 241 | ||
227 | memset(&ourGlobals, 0, sizeof(gameGlobals)); | 242 | memset(&ourGlobals, 0, sizeof(gameGlobals)); |
228 | ourGlobals.address = "127.0.0.1"; | 243 | ourGlobals.address = "127.0.0.1"; |
diff --git a/src/LuaSL/test.sh b/src/LuaSL/test.sh deleted file mode 100755 index e8471c8..0000000 --- a/src/LuaSL/test.sh +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | #! /bin/bash | ||
2 | |||
3 | wd=$(pwd) | ||
4 | |||
5 | # Kill any left overs. | ||
6 | killall -KILL LuaSL | ||
7 | export LUA_PATH="$wd/../../lib/?.lua" | ||
8 | |||
9 | case $@ in | ||
10 | |||
11 | ddd) | ||
12 | ddd ../../LuaSL | ||
13 | ;; | ||
14 | |||
15 | gdb) | ||
16 | gdb ../../LuaSL | ||
17 | ;; | ||
18 | |||
19 | *) | ||
20 | echo "_______________ STARTING LuaSL _______________" | ||
21 | ../../LuaSL & | ||
22 | sleep 1 | ||
23 | echo "_______________ STARTING love _______________" | ||
24 | ../../love | ||
25 | ;; | ||
26 | |||
27 | esac | ||
diff --git a/src/extantz/build.lua b/src/extantz/build.lua index caca02f..1591e8a 100755 --- a/src/extantz/build.lua +++ b/src/extantz/build.lua | |||
@@ -15,7 +15,7 @@ end | |||
15 | 15 | ||
16 | CFLAGS = CFLAGS .. ' -I../../libraries/irrlicht-1.8.1/include -I/usr/X11R6/include -I../GuiLua' | 16 | CFLAGS = CFLAGS .. ' -I../../libraries/irrlicht-1.8.1/include -I/usr/X11R6/include -I../GuiLua' |
17 | LDFLAGS = LDFLAGS .. ' -L../../libraries/irrlicht-1.8.1/lib/Linux' | 17 | LDFLAGS = LDFLAGS .. ' -L../../libraries/irrlicht-1.8.1/lib/Linux' |
18 | libs = libs .. ' -lIrrlicht -lGL -lbz2 -lGuiLua -lwinFang' | 18 | libs = libs .. ' -lIrrlicht -lGL -lbz2 -lGuiLua -lwinFang -lRunnr' |
19 | 19 | ||
20 | removeFiles(dir, {'crappisspuke.o', 'CDemo.o', 'extantzCamera.o', 'gears.o', 'ephysics_demo.o', 'Evas_3D_demo.o', '../../media/extantz.edj'}) | 20 | removeFiles(dir, {'crappisspuke.o', 'CDemo.o', 'extantzCamera.o', 'gears.o', 'ephysics_demo.o', 'Evas_3D_demo.o', '../../media/extantz.edj'}) |
21 | removeFiles(dir, {'../../extantz', 'camera.o', 'files.o', 'scenri.o', 'woMan.o'}) | 21 | removeFiles(dir, {'../../extantz', 'camera.o', 'files.o', 'scenri.o', 'woMan.o'}) |
diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index b422343..c077f44 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c | |||
@@ -1,3 +1,5 @@ | |||
1 | #include <unistd.h> | ||
2 | |||
1 | #include "extantz.h" | 3 | #include "extantz.h" |
2 | #include "SledjHamr.h" | 4 | #include "SledjHamr.h" |
3 | #include "LumbrJack.h" | 5 | #include "LumbrJack.h" |
@@ -408,7 +410,7 @@ void overlay_add(globals *ourGlobals) | |||
408 | EAPI_MAIN int elm_main(int argc, char **argv) | 410 | EAPI_MAIN int elm_main(int argc, char **argv) |
409 | { | 411 | { |
410 | GLData *gld = NULL; | 412 | GLData *gld = NULL; |
411 | char buf[PATH_MAX]; | 413 | char buf[PATH_MAX * 2], *env; |
412 | // Eina_Bool gotWebKit = elm_need_web(); // Initialise ewebkit if it exists, or return EINA_FALSE if it don't. | 414 | // Eina_Bool gotWebKit = elm_need_web(); // Initialise ewebkit if it exists, or return EINA_FALSE if it don't. |
413 | 415 | ||
414 | /* Set the locale according to the system pref. | 416 | /* Set the locale according to the system pref. |
@@ -428,6 +430,21 @@ EAPI_MAIN int elm_main(int argc, char **argv) | |||
428 | 430 | ||
429 | logDom = loggingStartup("extantz", logDom); | 431 | logDom = loggingStartup("extantz", logDom); |
430 | 432 | ||
433 | // Add extras, so we can run test.lua later. | ||
434 | env = getenv("LUA_CPATH"); | ||
435 | if (!env) env = ""; | ||
436 | sprintf(buf, "%s;%s/src/GuiLua/?.so", env, elm_app_bin_dir_get()); | ||
437 | setenv("LUA_CPATH", buf, 1); | ||
438 | |||
439 | env = getenv("LUA_PATH"); | ||
440 | if (!env) env = ""; | ||
441 | sprintf(buf, "%s;%s/src/GuiLua/?.lua", env, elm_app_bin_dir_get()); | ||
442 | setenv("LUA_PATH", buf, 1); | ||
443 | |||
444 | sprintf(buf, "%s/love &", elm_app_bin_dir_get()); | ||
445 | system(buf); | ||
446 | sleep(1); | ||
447 | |||
431 | // Don't do this, we need to clean up other stuff to, so set a clean up function below. | 448 | // Don't do this, we need to clean up other stuff to, so set a clean up function below. |
432 | //elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); | 449 | //elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); |
433 | elm_policy_set(ELM_POLICY_EXIT, ELM_POLICY_EXIT_NONE); | 450 | elm_policy_set(ELM_POLICY_EXIT, ELM_POLICY_EXIT_NONE); |
diff --git a/src/love/love.c b/src/love/love.c index b0d1c05..6a3cdaa 100644 --- a/src/love/love.c +++ b/src/love/love.c | |||
@@ -11,6 +11,8 @@ Dedicated to my girl Boots, coz she means the world to me. | |||
11 | #include <Ecore_File.h> | 11 | #include <Ecore_File.h> |
12 | #include <Edje.h> | 12 | #include <Edje.h> |
13 | 13 | ||
14 | #include <unistd.h> | ||
15 | |||
14 | #include "LumbrJack.h" | 16 | #include "LumbrJack.h" |
15 | #include "Runnr.h" | 17 | #include "Runnr.h" |
16 | 18 | ||
@@ -377,6 +379,11 @@ int main(int argc, char **argv) | |||
377 | char *programName = argv[0]; | 379 | char *programName = argv[0]; |
378 | boolean badArgs = FALSE; | 380 | boolean badArgs = FALSE; |
379 | int result = EXIT_FAILURE; | 381 | int result = EXIT_FAILURE; |
382 | char buf[PATH_MAX]; | ||
383 | |||
384 | sprintf(buf, "%s/LuaSL &", PACKAGE_BIN_DIR); | ||
385 | system(buf); | ||
386 | sleep(1); | ||
380 | 387 | ||
381 | memset(&ourGlobals, 0, sizeof(gameGlobals)); | 388 | memset(&ourGlobals, 0, sizeof(gameGlobals)); |
382 | ourGlobals.address = "127.0.0.1"; | 389 | ourGlobals.address = "127.0.0.1"; |