aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rwxr-xr-xextantz.sh7
-rw-r--r--src/LuaSL/LuaSL_main.c19
-rwxr-xr-xsrc/LuaSL/test.sh27
-rwxr-xr-xsrc/extantz/build.lua2
-rw-r--r--src/extantz/extantz.c19
-rw-r--r--src/love/love.c7
-rwxr-xr-xtest.sh6
7 files changed, 46 insertions, 41 deletions
diff --git a/extantz.sh b/extantz.sh
deleted file mode 100755
index da274a8..0000000
--- a/extantz.sh
+++ /dev/null
@@ -1,7 +0,0 @@
1#! /bin/bash
2
3wd=$(pwd)
4
5export LUA_PATH="$wd/src/GuiLua/?.lua"
6export LUA_CPATH="$wd/src/GuiLua/?.so"
7./extantz
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
222int main(int argc, char **argv) 222int 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
3wd=$(pwd)
4
5# Kill any left overs.
6killall -KILL LuaSL
7export LUA_PATH="$wd/../../lib/?.lua"
8
9case $@ 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
27esac
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
16CFLAGS = CFLAGS .. ' -I../../libraries/irrlicht-1.8.1/include -I/usr/X11R6/include -I../GuiLua' 16CFLAGS = CFLAGS .. ' -I../../libraries/irrlicht-1.8.1/include -I/usr/X11R6/include -I../GuiLua'
17LDFLAGS = LDFLAGS .. ' -L../../libraries/irrlicht-1.8.1/lib/Linux' 17LDFLAGS = LDFLAGS .. ' -L../../libraries/irrlicht-1.8.1/lib/Linux'
18libs = libs .. ' -lIrrlicht -lGL -lbz2 -lGuiLua -lwinFang' 18libs = libs .. ' -lIrrlicht -lGL -lbz2 -lGuiLua -lwinFang -lRunnr'
19 19
20removeFiles(dir, {'crappisspuke.o', 'CDemo.o', 'extantzCamera.o', 'gears.o', 'ephysics_demo.o', 'Evas_3D_demo.o', '../../media/extantz.edj'}) 20removeFiles(dir, {'crappisspuke.o', 'CDemo.o', 'extantzCamera.o', 'gears.o', 'ephysics_demo.o', 'Evas_3D_demo.o', '../../media/extantz.edj'})
21removeFiles(dir, {'../../extantz', 'camera.o', 'files.o', 'scenri.o', 'woMan.o'}) 21removeFiles(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)
408EAPI_MAIN int elm_main(int argc, char **argv) 410EAPI_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";
diff --git a/test.sh b/test.sh
index c560633..a6d3423 100755
--- a/test.sh
+++ b/test.sh
@@ -15,6 +15,6 @@ cd $wd/src/GuiLua
15./test.sh & 15./test.sh &
16sleep 1 16sleep 1
17 17
18echo "_______________ TESTING LuaSL _______________" 18echo "_______________ TESTING love and LuaSL _______________"
19cd $wd/src/LuaSL 19cd $wd
20./test.sh $0 20./love $0