From f136a1af33253a4149c4a3a366845727f36d6567 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sat, 21 Jan 2012 22:34:46 +1000 Subject: Disable some of the output, and compile every script in the test sim. --- LuaSL/src/LuaSL_compile.c | 13 +++++++------ LuaSL/src/LuaSL_main.c | 34 ++++++++++++++++++++++++++++------ 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c index cb64038..18deda3 100644 --- a/LuaSL/src/LuaSL_compile.c +++ b/LuaSL/src/LuaSL_compile.c @@ -1015,9 +1015,9 @@ static LSL_Leaf *evaluateStatementToken(LSL_Leaf *content, LSL_Leaf *left, LSL_L { switch (result->basicType) { - case OT_float : printf("\nResult is the float %g.\n", result->value.floatValue); break; - case OT_integer : printf("\nResult is the integer %d.\n", result->value.integerValue); break; - default : printf("\nResult of an unknown type [%d] %d!\n", result->basicType, result->value.integerValue); break; + case OT_float : printf("Result is the float %g.\n", result->value.floatValue); break; + case OT_integer : printf("Result is the integer %d.\n", result->value.integerValue); break; + default : /*printf("\nResult of an unknown type [%d] %d!\n", result->basicType, result->value.integerValue);*/ break; } free(result); result = NULL; @@ -1184,10 +1184,10 @@ static void doneParsing(LuaSL_compiler *compiler) char outName[PATH_MAX]; char luaName[PATH_MAX]; - outputLeaf(stdout, OM_LSL, compiler->ast); - printf("\n"); +// outputLeaf(stdout, OM_LSL, compiler->ast); +// printf("\n"); evaluateLeaf(compiler->ast, NULL, NULL); - printf("\n"); +// printf("\n"); strcpy(outName, compiler->fileName); strcat(outName, "2"); @@ -1285,6 +1285,7 @@ Eina_Bool compileLSL(gameGlobals *game, char *script, boolean doConstants) PE("Error opening file %s.", compiler.fileName); return FALSE; } + printf("\n"); PI("Opened %s.", compiler.fileName); compiler.ast = NULL; compiler.lval = newLeaf(LSL_UNKNOWN, NULL, NULL); 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__) ecore_main_loop_quit(); } +void dirList_cb(const char *name, const char *path, void *data) +{ + gameGlobals *game = data; + char buf[PATH_MAX]; + char *ext = rindex(name, '.'); + + if (ext) + { + if (0 == strcmp(ext, ".lsl")) + { + snprintf(buf, sizeof(buf), "%s/%s", path, name); + if (compileLSL(game, buf, FALSE)) + PI("Against all odds, the compile of %s worked! lol", buf); + else + PE("The compile of %s failed!", buf); + } + } +} + int main(int argc, char **argv) { @@ -160,14 +179,17 @@ main(int argc, char **argv) ecore_evas_callback_delete_request_set(game.ee, _on_delete); edje_object_signal_callback_add(game.edje, "*", "game_*", _edje_signal_cb, &game); - // Setup for the compler. + // Setup for the compiler. compilerSetup(&game); + + snprintf(buf, sizeof(buf), "%s/Test sim/objects", PACKAGE_DATA_DIR); + eina_file_dir_list(buf, EINA_TRUE, dirList_cb, &game); // snprintf(buf, sizeof(buf), "%s/Test sim/objects/onefang's test bed/~run", PACKAGE_DATA_DIR); - snprintf(buf, sizeof(buf), "%s/test2.lsl", PACKAGE_DATA_DIR); - if (compileLSL(&game, buf, FALSE)) - PIm("Against all odds, the compile of %s worked! lol", buf); - else - PEm("The compile of %s failed!", buf); +// snprintf(buf, sizeof(buf), "%s/test2.lsl", PACKAGE_DATA_DIR); +// if (compileLSL(&game, buf, FALSE)) +// PIm("Against all odds, the compile of %s worked! lol", buf); +// else +// PEm("The compile of %s failed!", buf); snprintf(buf, sizeof(buf), "%s/test.lsl", PACKAGE_DATA_DIR); compileLSL(&game, buf, FALSE); -- cgit v1.1