diff options
Diffstat (limited to 'LuaSL/src/LuaSL_main.c')
-rw-r--r-- | LuaSL/src/LuaSL_main.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/LuaSL/src/LuaSL_main.c b/LuaSL/src/LuaSL_main.c index e0d2629..2fb8512 100644 --- a/LuaSL/src/LuaSL_main.c +++ b/LuaSL/src/LuaSL_main.c | |||
@@ -66,6 +66,25 @@ _on_delete(Ecore_Evas *ee __UNUSED__) | |||
66 | ecore_main_loop_quit(); | 66 | ecore_main_loop_quit(); |
67 | } | 67 | } |
68 | 68 | ||
69 | void dirList_cb(const char *name, const char *path, void *data) | ||
70 | { | ||
71 | gameGlobals *game = data; | ||
72 | char buf[PATH_MAX]; | ||
73 | char *ext = rindex(name, '.'); | ||
74 | |||
75 | if (ext) | ||
76 | { | ||
77 | if (0 == strcmp(ext, ".lsl")) | ||
78 | { | ||
79 | snprintf(buf, sizeof(buf), "%s/%s", path, name); | ||
80 | if (compileLSL(game, buf, FALSE)) | ||
81 | PI("Against all odds, the compile of %s worked! lol", buf); | ||
82 | else | ||
83 | PE("The compile of %s failed!", buf); | ||
84 | } | ||
85 | } | ||
86 | } | ||
87 | |||
69 | int | 88 | int |
70 | main(int argc, char **argv) | 89 | main(int argc, char **argv) |
71 | { | 90 | { |
@@ -160,14 +179,17 @@ main(int argc, char **argv) | |||
160 | ecore_evas_callback_delete_request_set(game.ee, _on_delete); | 179 | ecore_evas_callback_delete_request_set(game.ee, _on_delete); |
161 | edje_object_signal_callback_add(game.edje, "*", "game_*", _edje_signal_cb, &game); | 180 | edje_object_signal_callback_add(game.edje, "*", "game_*", _edje_signal_cb, &game); |
162 | 181 | ||
163 | // Setup for the compler. | 182 | // Setup for the compiler. |
164 | compilerSetup(&game); | 183 | compilerSetup(&game); |
184 | |||
185 | snprintf(buf, sizeof(buf), "%s/Test sim/objects", PACKAGE_DATA_DIR); | ||
186 | eina_file_dir_list(buf, EINA_TRUE, dirList_cb, &game); | ||
165 | // snprintf(buf, sizeof(buf), "%s/Test sim/objects/onefang's test bed/~run", PACKAGE_DATA_DIR); | 187 | // snprintf(buf, sizeof(buf), "%s/Test sim/objects/onefang's test bed/~run", PACKAGE_DATA_DIR); |
166 | snprintf(buf, sizeof(buf), "%s/test2.lsl", PACKAGE_DATA_DIR); | 188 | // snprintf(buf, sizeof(buf), "%s/test2.lsl", PACKAGE_DATA_DIR); |
167 | if (compileLSL(&game, buf, FALSE)) | 189 | // if (compileLSL(&game, buf, FALSE)) |
168 | PIm("Against all odds, the compile of %s worked! lol", buf); | 190 | // PIm("Against all odds, the compile of %s worked! lol", buf); |
169 | else | 191 | // else |
170 | PEm("The compile of %s failed!", buf); | 192 | // PEm("The compile of %s failed!", buf); |
171 | snprintf(buf, sizeof(buf), "%s/test.lsl", PACKAGE_DATA_DIR); | 193 | snprintf(buf, sizeof(buf), "%s/test.lsl", PACKAGE_DATA_DIR); |
172 | compileLSL(&game, buf, FALSE); | 194 | compileLSL(&game, buf, FALSE); |
173 | 195 | ||