diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/cembed/cembed.c | 6 | ||||
-rw-r--r-- | src/jin/main.cpp | 1 | ||||
-rw-r--r-- | src/libjin-lua/embed/ai.lua.h | 2 | ||||
-rw-r--r-- | src/libjin-lua/embed/app.lua.h | 342 | ||||
-rw-r--r-- | src/libjin-lua/embed/graphics.lua.h | 2 | ||||
-rw-r--r-- | src/libjin-lua/embed/je_lua_embed.h (renamed from src/libjin-lua/embed/embed.h) | 29 | ||||
-rw-r--r-- | src/libjin-lua/embed/keyboard.lua.h | 22 | ||||
-rw-r--r-- | src/libjin-lua/embed/mouse.lua.h | 22 | ||||
-rw-r--r-- | src/libjin-lua/embed/net.lua.h | 2 | ||||
-rw-r--r-- | src/libjin-lua/embed/path.lua.h | 23 | ||||
-rw-r--r-- | src/libjin-lua/embed/scripts/app.lua | 1 | ||||
-rw-r--r-- | src/libjin-lua/embed/scripts/keyboard/keyboard.lua | 1 | ||||
-rw-r--r-- | src/libjin-lua/embed/scripts/mouse/mouse.lua | 1 | ||||
-rw-r--r-- | src/libjin-lua/embed/scripts/path/path.lua | 3 | ||||
-rw-r--r-- | src/libjin-lua/embed/state_machine.lua.h | 2 | ||||
-rw-r--r-- | src/libjin-lua/je_lua_jin.cpp | 7 |
16 files changed, 243 insertions, 223 deletions
diff --git a/src/3rdparty/cembed/cembed.c b/src/3rdparty/cembed/cembed.c index 1adcf83..c4e9c87 100644 --- a/src/3rdparty/cembed/cembed.c +++ b/src/3rdparty/cembed/cembed.c @@ -31,7 +31,7 @@ typedef struct { FILE *fp; - unsigned char buf[4096]; + char buf[4096]; int idx; int eof_idx; } BufferedFile; @@ -99,7 +99,7 @@ static void safename(char *dst, const char *filename) { } -static void write_byte_string(BufferedFile *bf, unsigned char n) { +static void write_byte_string(BufferedFile *bf, char n) { if (n >= 100) { bf_write_byte(bf, '0' + (n / 100) % 10); } if (n >= 10) { bf_write_byte(bf, '0' + (n / 10) % 10); } bf_write_byte(bf, '0' + n % 10); @@ -130,7 +130,7 @@ static void write_embedded(FILE *fp, const char *filename, fprintf(fp, "/*Auto generated, don't modify by hand.*/\n"); if (!nostatic) { fprintf(fp, "static "); } - fprintf(fp, "unsigned char %s%s[] = {", varprefix, varname); + fprintf(fp, "char %s%s[] = {", varprefix, varname); BufferedFile inbf = bf_reader(infp); BufferedFile bf = bf_writer(fp); int n = 0; diff --git a/src/jin/main.cpp b/src/jin/main.cpp index 4b6f615..9d7fcbe 100644 --- a/src/jin/main.cpp +++ b/src/jin/main.cpp @@ -15,6 +15,7 @@ using namespace JinEngine::Filesystem; static void load(const char* cwd) { + jin_log_info("Currrent working directory is %s", cwd); // Main thread lua state. lua_State* L = luax_newstate(); luax_openlibs(L); diff --git a/src/libjin-lua/embed/ai.lua.h b/src/libjin-lua/embed/ai.lua.h index cbc5f81..b1dc681 100644 --- a/src/libjin-lua/embed/ai.lua.h +++ b/src/libjin-lua/embed/ai.lua.h @@ -1,5 +1,5 @@ /*Auto generated, don't modify by hand.*/ -static unsigned char ai_lua[] = { +static char ai_lua[] = { 106,105,110,46,97,105,32,61,32,106,105,110,46,97,105,32,111,114,32,123, 125,32,13,10,13,10,108,111,99,97,108,32,106,97,32,61,32,106,105,110, 46,97,105,13,10,13,10,106,97,46,83,116,97,116,101,77,97,99,104,105, diff --git a/src/libjin-lua/embed/app.lua.h b/src/libjin-lua/embed/app.lua.h index e941b6d..9799c00 100644 --- a/src/libjin-lua/embed/app.lua.h +++ b/src/libjin-lua/embed/app.lua.h @@ -1,144 +1,120 @@ /*Auto generated, don't modify by hand.*/ -static unsigned char app_lua[] = { -106,105,110,46,102,105,108,101,115,121,115,116,101,109,46,105,110,105,116,40, -41,13,10,106,105,110,46,102,105,108,101,115,121,115,116,101,109,46,109,111, -117,110,116,40,106,105,110,46,99,119,100,41,13,10,13,10,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,13,10,45,45,32,67,111,110,102,105,103, -32,103,97,109,101,13,10,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -13,10,13,10,106,105,110,46,99,111,110,102,105,103,32,32,61,32,123,125, -32,13,10,105,102,32,106,105,110,46,102,105,108,101,115,121,115,116,101,109, -46,101,120,105,115,116,40,34,99,111,110,102,105,103,46,108,117,97,34,41, -32,116,104,101,110,32,13,10,32,32,32,32,120,112,99,97,108,108,40,102, -117,110,99,116,105,111,110,40,41,106,105,110,46,99,111,110,102,105,103,32, -61,32,114,101,113,117,105,114,101,32,34,99,111,110,102,105,103,34,32,101, -110,100,44,32,102,117,110,99,116,105,111,110,40,41,101,110,100,41,32,32, -32,32,13,10,101,110,100,13,10,106,105,110,46,99,111,110,102,105,103,46, -119,105,100,116,104,32,32,32,32,32,32,61,32,106,105,110,46,99,111,110, -102,105,103,46,119,105,100,116,104,32,32,32,32,32,32,111,114,32,53,56, -48,32,13,10,106,105,110,46,99,111,110,102,105,103,46,104,101,105,103,104, -116,32,32,32,32,32,61,32,106,105,110,46,99,111,110,102,105,103,46,104, -101,105,103,104,116,32,32,32,32,32,111,114,32,52,53,48,32,13,10,106, -105,110,46,99,111,110,102,105,103,46,118,115,121,110,99,32,32,32,32,32, -32,61,32,106,105,110,46,99,111,110,102,105,103,46,118,115,121,110,99,32, -32,32,32,32,32,111,114,32,116,114,117,101,13,10,106,105,110,46,99,111, -110,102,105,103,46,116,105,116,108,101,32,32,32,32,32,32,61,32,106,105, -110,46,99,111,110,102,105,103,46,116,105,116,108,101,32,32,32,32,32,32, -111,114,32,40,34,106,105,110,32,118,34,32,46,46,32,106,105,110,46,118, -101,114,115,105,111,110,41,13,10,106,105,110,46,99,111,110,102,105,103,46, -114,101,115,105,122,97,98,108,101,32,32,61,32,106,105,110,46,99,111,110, -102,105,103,46,114,101,115,105,122,97,98,108,101,32,32,111,114,32,102,97, -108,115,101,32,13,10,106,105,110,46,99,111,110,102,105,103,46,102,117,108, -108,115,99,114,101,101,110,32,61,32,106,105,110,46,99,111,110,102,105,103, -46,102,117,108,108,115,99,114,101,101,110,32,111,114,32,102,97,108,115,101, -13,10,106,105,110,46,99,111,110,102,105,103,46,102,112,115,32,32,32,32, -32,32,32,32,61,32,106,105,110,46,99,111,110,102,105,103,46,102,112,115, -32,32,32,32,32,32,32,32,111,114,32,54,48,13,10,106,105,110,46,99, -111,110,102,105,103,46,105,99,111,110,32,32,32,32,32,32,32,61,32,106, -105,110,46,99,111,110,102,105,103,46,105,99,111,110,32,32,32,32,32,32, -32,111,114,32,34,34,13,10,13,10,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,13,10,45,45,32,68,101,102,97,117,108,116,32,103,97,109,101, -32,108,111,111,112,13,10,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -13,10,13,10,108,111,99,97,108,32,102,117,110,99,116,105,111,110,32,99, -97,108,108,40,102,117,110,99,44,32,46,46,46,41,13,10,32,32,32,32, -105,102,32,102,117,110,99,32,116,104,101,110,32,13,10,32,32,32,32,32, -32,32,32,114,101,116,117,114,110,32,102,117,110,99,40,46,46,46,41,13, -10,32,32,32,32,101,110,100,13,10,101,110,100,13,10,13,10,108,111,99, -97,108,32,115,116,101,112,32,61,32,106,105,110,46,116,105,109,101,46,115, -116,101,112,13,10,106,105,110,46,116,105,109,101,46,115,116,101,112,32,61, -32,110,105,108,13,10,13,10,102,117,110,99,116,105,111,110,32,106,105,110, -46,99,111,114,101,46,114,117,110,40,41,13,10,32,32,32,32,106,105,110, -46,103,114,97,112,104,105,99,115,46,114,101,115,101,116,40,41,13,10,32, -32,32,32,99,97,108,108,40,106,105,110,46,99,111,114,101,46,111,110,76, -111,97,100,41,13,10,32,32,32,32,108,111,99,97,108,32,100,116,32,61, -32,48,13,10,32,32,32,32,119,104,105,108,101,32,106,105,110,46,99,111, -114,101,46,114,117,110,110,105,110,103,40,41,32,100,111,13,10,32,32,32, -32,32,32,32,32,102,111,114,32,95,44,32,101,32,105,110,32,112,97,105, -114,115,40,106,105,110,46,101,118,101,110,116,46,112,111,108,108,40,41,41, -32,100,111,32,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102, -32,101,46,116,121,112,101,32,61,61,32,34,75,101,121,68,111,119,110,34, -32,116,104,101,110,32,13,10,32,32,32,32,32,32,32,32,32,32,32,32, -32,32,32,32,106,105,110,46,107,101,121,98,111,97,114,100,46,115,101,116, -40,101,46,107,101,121,44,32,116,114,117,101,41,32,13,10,32,32,32,32, -32,32,32,32,32,32,32,32,101,108,115,101,105,102,32,101,46,116,121,112, -101,32,61,61,32,34,75,101,121,85,112,34,32,116,104,101,110,32,13,10, -32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,106,105,110,46, -107,101,121,98,111,97,114,100,46,115,101,116,40,101,46,107,101,121,44,32, -102,97,108,115,101,41,13,10,32,32,32,32,32,32,32,32,32,32,32,32, -101,110,100,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99,97,108, -108,40,106,105,110,46,99,111,114,101,46,111,110,69,118,101,110,116,44,32, -101,41,13,10,32,32,32,32,32,32,32,32,101,110,100,13,10,32,32,32, -32,32,32,32,32,115,116,101,112,40,41,13,10,32,32,32,32,32,32,32, -32,100,116,32,61,32,106,105,110,46,116,105,109,101,46,103,101,116,68,101, -108,116,97,40,41,13,10,32,32,32,32,32,32,32,32,99,97,108,108,40, -106,105,110,46,99,111,114,101,46,111,110,85,112,100,97,116,101,44,32,100, -116,41,13,10,32,32,32,32,32,32,32,32,106,105,110,46,103,114,97,112, -104,105,99,115,46,99,108,101,97,114,40,41,32,32,32,32,32,32,32,32, -13,10,32,32,32,32,32,32,32,32,99,97,108,108,40,106,105,110,46,99, -111,114,101,46,111,110,68,114,97,119,41,13,10,32,32,32,32,32,32,32, -32,106,105,110,46,103,114,97,112,104,105,99,115,46,112,114,101,115,101,110, -116,40,41,13,10,32,32,32,32,32,32,32,32,106,105,110,46,116,105,109, -101,46,115,108,101,101,112,40,48,46,48,48,49,41,13,10,32,32,32,32, -101,110,100,13,10,101,110,100,13,10,13,10,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,13,10,45,45,32,66,111,111,116,32,103,97,109,101,13, -10,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,13,10,13,10,45,45, -32,68,105,115,112,108,97,121,32,101,114,114,111,114,32,109,101,115,115,97, -103,101,46,13,10,108,111,99,97,108,32,102,117,110,99,116,105,111,110,32, -111,110,69,114,114,111,114,40,109,115,103,41,32,13,10,32,32,32,32,106, -105,110,46,97,117,100,105,111,46,100,101,115,116,114,111,121,40,41,13,10, -32,32,32,32,106,105,110,46,103,114,97,112,104,105,99,115,46,115,104,111, -119,87,105,110,100,111,119,40,41,13,10,32,32,32,32,108,111,99,97,108, -32,101,114,114,32,61,32,34,69,114,114,111,114,58,92,110,34,32,46,46, -32,109,115,103,32,46,46,32,34,92,110,34,32,46,46,32,100,101,98,117, -103,46,116,114,97,99,101,98,97,99,107,40,41,13,10,32,32,32,32,106, +static char app_lua[] = { +13,10,106,105,110,46,102,105,108,101,115,121,115,116,101,109,46,105,110,105, +116,40,41,13,10,106,105,110,46,102,105,108,101,115,121,115,116,101,109,46, +109,111,117,110,116,40,106,105,110,46,99,119,100,41,13,10,13,10,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,13,10,45,45,32,67,111,110,102, +105,103,32,103,97,109,101,13,10,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,13,10,13,10,106,105,110,46,99,111,110,102,105,103,32,32,61,32, +123,125,32,13,10,105,102,32,106,105,110,46,102,105,108,101,115,121,115,116, +101,109,46,101,120,105,115,116,40,34,99,111,110,102,105,103,46,108,117,97, +34,41,32,116,104,101,110,32,13,10,32,32,32,32,120,112,99,97,108,108, +40,102,117,110,99,116,105,111,110,40,41,106,105,110,46,99,111,110,102,105, +103,32,61,32,114,101,113,117,105,114,101,32,34,99,111,110,102,105,103,34, +32,101,110,100,44,32,102,117,110,99,116,105,111,110,40,41,101,110,100,41, +32,32,32,32,13,10,101,110,100,13,10,106,105,110,46,99,111,110,102,105, +103,46,119,105,100,116,104,32,32,32,32,32,32,61,32,106,105,110,46,99, +111,110,102,105,103,46,119,105,100,116,104,32,32,32,32,32,32,111,114,32, +53,56,48,32,13,10,106,105,110,46,99,111,110,102,105,103,46,104,101,105, +103,104,116,32,32,32,32,32,61,32,106,105,110,46,99,111,110,102,105,103, +46,104,101,105,103,104,116,32,32,32,32,32,111,114,32,52,53,48,32,13, +10,106,105,110,46,99,111,110,102,105,103,46,118,115,121,110,99,32,32,32, +32,32,32,61,32,106,105,110,46,99,111,110,102,105,103,46,118,115,121,110, +99,32,32,32,32,32,32,111,114,32,116,114,117,101,13,10,106,105,110,46, +99,111,110,102,105,103,46,116,105,116,108,101,32,32,32,32,32,32,61,32, +106,105,110,46,99,111,110,102,105,103,46,116,105,116,108,101,32,32,32,32, +32,32,111,114,32,40,34,106,105,110,32,118,34,32,46,46,32,106,105,110, +46,118,101,114,115,105,111,110,41,13,10,106,105,110,46,99,111,110,102,105, +103,46,114,101,115,105,122,97,98,108,101,32,32,61,32,106,105,110,46,99, +111,110,102,105,103,46,114,101,115,105,122,97,98,108,101,32,32,111,114,32, +102,97,108,115,101,32,13,10,106,105,110,46,99,111,110,102,105,103,46,102, +117,108,108,115,99,114,101,101,110,32,61,32,106,105,110,46,99,111,110,102, +105,103,46,102,117,108,108,115,99,114,101,101,110,32,111,114,32,102,97,108, +115,101,13,10,106,105,110,46,99,111,110,102,105,103,46,102,112,115,32,32, +32,32,32,32,32,32,61,32,106,105,110,46,99,111,110,102,105,103,46,102, +112,115,32,32,32,32,32,32,32,32,111,114,32,54,48,13,10,106,105,110, +46,99,111,110,102,105,103,46,105,99,111,110,32,32,32,32,32,32,32,61, +32,106,105,110,46,99,111,110,102,105,103,46,105,99,111,110,32,32,32,32, +32,32,32,111,114,32,34,34,13,10,13,10,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,13,10,45,45,32,68,101,102,97,117,108,116,32,103,97, +109,101,32,108,111,111,112,13,10,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,13,10,13,10,108,111,99,97,108,32,102,117,110,99,116,105,111,110, +32,99,97,108,108,40,102,117,110,99,44,32,46,46,46,41,13,10,32,32, +32,32,105,102,32,102,117,110,99,32,116,104,101,110,32,13,10,32,32,32, +32,32,32,32,32,114,101,116,117,114,110,32,102,117,110,99,40,46,46,46, +41,13,10,32,32,32,32,101,110,100,13,10,101,110,100,13,10,13,10,108, +111,99,97,108,32,115,116,101,112,32,61,32,106,105,110,46,116,105,109,101, +46,115,116,101,112,13,10,106,105,110,46,116,105,109,101,46,115,116,101,112, +32,61,32,110,105,108,13,10,13,10,102,117,110,99,116,105,111,110,32,106, +105,110,46,99,111,114,101,46,114,117,110,40,41,13,10,32,32,32,32,106, 105,110,46,103,114,97,112,104,105,99,115,46,114,101,115,101,116,40,41,13, -10,32,32,32,32,106,105,110,46,103,114,97,112,104,105,99,115,46,115,101, -116,67,108,101,97,114,67,111,108,111,114,40,49,48,48,44,32,49,48,48, -44,32,49,48,48,44,32,50,53,53,41,13,10,32,32,32,32,106,105,110, -46,103,114,97,112,104,105,99,115,46,99,108,101,97,114,40,41,13,10,32, -32,32,32,106,105,110,46,103,114,97,112,104,105,99,115,46,112,114,105,110, -116,40,101,114,114,44,32,53,44,32,53,41,13,10,32,32,32,32,106,105, -110,46,103,114,97,112,104,105,99,115,46,112,114,101,115,101,110,116,40,41, -13,10,32,32,32,32,119,104,105,108,101,32,106,105,110,46,99,111,114,101, -46,114,117,110,110,105,110,103,40,41,32,100,111,32,13,10,32,32,32,32, -32,32,32,32,102,111,114,32,95,44,32,101,32,105,110,32,112,97,105,114, -115,40,106,105,110,46,101,118,101,110,116,46,112,111,108,108,40,41,41,32, -100,111,32,13,10,32,32,32,32,32,32,32,32,32,32,32,32,105,102,32, -101,46,116,121,112,101,32,61,61,32,34,81,117,105,116,34,32,116,104,101, -110,32,13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32, -106,105,110,46,99,111,114,101,46,115,116,111,112,40,41,13,10,32,32,32, -32,32,32,32,32,32,32,32,32,101,110,100,13,10,32,32,32,32,32,32, -32,32,101,110,100,13,10,32,32,32,32,32,32,32,32,106,105,110,46,116, +10,32,32,32,32,99,97,108,108,40,106,105,110,46,99,111,114,101,46,111, +110,76,111,97,100,41,13,10,32,32,32,32,108,111,99,97,108,32,100,116, +32,61,32,48,13,10,32,32,32,32,119,104,105,108,101,32,106,105,110,46, +99,111,114,101,46,114,117,110,110,105,110,103,40,41,32,100,111,13,10,32, +32,32,32,32,32,32,32,102,111,114,32,95,44,32,101,32,105,110,32,112, +97,105,114,115,40,106,105,110,46,101,118,101,110,116,46,112,111,108,108,40, +41,41,32,100,111,32,13,10,32,32,32,32,32,32,32,32,32,32,32,32, +105,102,32,101,46,116,121,112,101,32,61,61,32,34,75,101,121,68,111,119, +110,34,32,116,104,101,110,32,13,10,32,32,32,32,32,32,32,32,32,32, +32,32,32,32,32,32,106,105,110,46,107,101,121,98,111,97,114,100,46,115, +101,116,40,101,46,107,101,121,44,32,116,114,117,101,41,32,13,10,32,32, +32,32,32,32,32,32,32,32,32,32,101,108,115,101,105,102,32,101,46,116, +121,112,101,32,61,61,32,34,75,101,121,85,112,34,32,116,104,101,110,32, +13,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,106,105, +110,46,107,101,121,98,111,97,114,100,46,115,101,116,40,101,46,107,101,121, +44,32,102,97,108,115,101,41,13,10,32,32,32,32,32,32,32,32,32,32, +32,32,101,110,100,13,10,32,32,32,32,32,32,32,32,32,32,32,32,99, +97,108,108,40,106,105,110,46,99,111,114,101,46,111,110,69,118,101,110,116, +44,32,101,41,13,10,32,32,32,32,32,32,32,32,101,110,100,13,10,32, +32,32,32,32,32,32,32,115,116,101,112,40,41,13,10,32,32,32,32,32, +32,32,32,100,116,32,61,32,106,105,110,46,116,105,109,101,46,103,101,116, +68,101,108,116,97,40,41,13,10,32,32,32,32,32,32,32,32,99,97,108, +108,40,106,105,110,46,99,111,114,101,46,111,110,85,112,100,97,116,101,44, +32,100,116,41,13,10,32,32,32,32,32,32,32,32,106,105,110,46,103,114, +97,112,104,105,99,115,46,99,108,101,97,114,40,41,32,32,32,32,32,32, +32,32,13,10,32,32,32,32,32,32,32,32,99,97,108,108,40,106,105,110, +46,99,111,114,101,46,111,110,68,114,97,119,41,13,10,32,32,32,32,32, +32,32,32,106,105,110,46,103,114,97,112,104,105,99,115,46,112,114,101,115, +101,110,116,40,41,13,10,32,32,32,32,32,32,32,32,106,105,110,46,116, 105,109,101,46,115,108,101,101,112,40,48,46,48,48,49,41,13,10,32,32, -32,32,101,110,100,13,10,101,110,100,13,10,13,10,45,45,32,78,111,32, -103,97,109,101,32,115,99,114,101,101,110,46,13,10,108,111,99,97,108,32, -102,117,110,99,116,105,111,110,32,110,111,71,97,109,101,40,41,13,10,32, -32,32,32,106,105,110,46,103,114,97,112,104,105,99,115,46,115,104,111,119, -87,105,110,100,111,119,40,41,13,10,32,32,32,32,106,105,110,46,103,114, -97,112,104,105,99,115,46,114,101,115,101,116,40,41,13,10,32,32,32,32, -106,105,110,46,103,114,97,112,104,105,99,115,46,115,101,116,67,108,101,97, -114,67,111,108,111,114,40,49,48,48,44,32,49,48,48,44,32,49,48,48, -44,32,50,53,53,41,13,10,32,32,32,32,106,105,110,46,103,114,97,112, -104,105,99,115,46,99,108,101,97,114,40,41,13,10,32,32,32,32,106,105, -110,46,103,114,97,112,104,105,99,115,46,112,114,105,110,116,40,34,78,111, -32,71,97,109,101,34,44,32,53,44,32,53,41,32,13,10,32,32,32,32, +32,32,101,110,100,13,10,101,110,100,13,10,13,10,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,13,10,45,45,32,66,111,111,116,32,103,97,109, +101,13,10,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,13,10,13,10, +45,45,32,68,105,115,112,108,97,121,32,101,114,114,111,114,32,109,101,115, +115,97,103,101,46,13,10,108,111,99,97,108,32,102,117,110,99,116,105,111, +110,32,111,110,69,114,114,111,114,40,109,115,103,41,32,13,10,32,32,32, +32,106,105,110,46,97,117,100,105,111,46,100,101,115,116,114,111,121,40,41, +13,10,32,32,32,32,106,105,110,46,103,114,97,112,104,105,99,115,46,115, +104,111,119,87,105,110,100,111,119,40,41,13,10,32,32,32,32,108,111,99, +97,108,32,101,114,114,32,61,32,34,69,114,114,111,114,58,92,110,34,32, +46,46,32,109,115,103,32,46,46,32,34,92,110,34,32,46,46,32,100,101, +98,117,103,46,116,114,97,99,101,98,97,99,107,40,41,13,10,32,32,32, +32,106,105,110,46,103,114,97,112,104,105,99,115,46,114,101,115,101,116,40, +41,13,10,32,32,32,32,106,105,110,46,103,114,97,112,104,105,99,115,46, +115,101,116,67,108,101,97,114,67,111,108,111,114,40,49,48,48,44,32,49, +48,48,44,32,49,48,48,44,32,50,53,53,41,13,10,32,32,32,32,106, +105,110,46,103,114,97,112,104,105,99,115,46,99,108,101,97,114,40,41,13, +10,32,32,32,32,106,105,110,46,103,114,97,112,104,105,99,115,46,112,114, +105,110,116,40,101,114,114,44,32,53,44,32,53,41,13,10,32,32,32,32, 106,105,110,46,103,114,97,112,104,105,99,115,46,112,114,101,115,101,110,116, 40,41,13,10,32,32,32,32,119,104,105,108,101,32,106,105,110,46,99,111, 114,101,46,114,117,110,110,105,110,103,40,41,32,100,111,32,13,10,32,32, @@ -151,58 +127,82 @@ static unsigned char app_lua[] = { 32,32,32,32,32,32,32,32,32,32,32,101,110,100,13,10,32,32,32,32, 32,32,32,32,101,110,100,13,10,32,32,32,32,32,32,32,32,106,105,110, 46,116,105,109,101,46,115,108,101,101,112,40,48,46,48,48,49,41,13,10, -32,32,32,32,101,110,100,13,10,101,110,100,13,10,13,10,108,111,99,97, -108,32,102,117,110,99,116,105,111,110,32,98,111,111,116,40,41,32,13,10, -32,32,32,32,105,102,32,106,105,110,46,102,105,108,101,115,121,115,116,101, -109,46,101,120,105,115,116,40,34,109,97,105,110,46,108,117,97,34,41,32, -116,104,101,110,32,13,10,32,32,32,32,32,32,32,32,99,97,108,108,40, -102,117,110,99,116,105,111,110,40,41,32,13,10,32,32,32,32,32,32,32, -32,32,32,32,32,114,101,113,117,105,114,101,34,109,97,105,110,34,32,13, -10,32,32,32,32,32,32,32,32,32,32,32,32,106,105,110,46,99,111,114, -101,46,114,117,110,40,41,13,10,32,32,32,32,32,32,32,32,101,110,100, -41,13,10,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32,32,32, -32,110,111,71,97,109,101,40,41,13,10,32,32,32,32,101,110,100,13,10, -101,110,100,13,10,13,10,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -13,10,45,45,32,73,110,105,116,105,97,108,105,122,101,32,115,117,98,32, -115,121,115,116,101,109,115,13,10,45,45,45,45,45,45,45,45,45,45,45, +32,32,32,32,101,110,100,13,10,101,110,100,13,10,13,10,45,45,32,78, +111,32,103,97,109,101,32,115,99,114,101,101,110,46,13,10,108,111,99,97, +108,32,102,117,110,99,116,105,111,110,32,110,111,71,97,109,101,40,41,13, +10,32,32,32,32,106,105,110,46,103,114,97,112,104,105,99,115,46,115,104, +111,119,87,105,110,100,111,119,40,41,13,10,32,32,32,32,106,105,110,46, +103,114,97,112,104,105,99,115,46,114,101,115,101,116,40,41,13,10,32,32, +32,32,106,105,110,46,103,114,97,112,104,105,99,115,46,115,101,116,67,108, +101,97,114,67,111,108,111,114,40,49,48,48,44,32,49,48,48,44,32,49, +48,48,44,32,50,53,53,41,13,10,32,32,32,32,106,105,110,46,103,114, +97,112,104,105,99,115,46,99,108,101,97,114,40,41,13,10,32,32,32,32, +106,105,110,46,103,114,97,112,104,105,99,115,46,112,114,105,110,116,40,34, +78,111,32,71,97,109,101,34,44,32,53,44,32,53,41,32,13,10,32,32, +32,32,106,105,110,46,103,114,97,112,104,105,99,115,46,112,114,101,115,101, +110,116,40,41,13,10,32,32,32,32,119,104,105,108,101,32,106,105,110,46, +99,111,114,101,46,114,117,110,110,105,110,103,40,41,32,100,111,32,13,10, +32,32,32,32,32,32,32,32,102,111,114,32,95,44,32,101,32,105,110,32, +112,97,105,114,115,40,106,105,110,46,101,118,101,110,116,46,112,111,108,108, +40,41,41,32,100,111,32,13,10,32,32,32,32,32,32,32,32,32,32,32, +32,105,102,32,101,46,116,121,112,101,32,61,61,32,34,81,117,105,116,34, +32,116,104,101,110,32,13,10,32,32,32,32,32,32,32,32,32,32,32,32, +32,32,32,32,106,105,110,46,99,111,114,101,46,115,116,111,112,40,41,13, +10,32,32,32,32,32,32,32,32,32,32,32,32,101,110,100,13,10,32,32, +32,32,32,32,32,32,101,110,100,13,10,32,32,32,32,32,32,32,32,106, +105,110,46,116,105,109,101,46,115,108,101,101,112,40,48,46,48,48,49,41, +13,10,32,32,32,32,101,110,100,13,10,101,110,100,13,10,13,10,108,111, +99,97,108,32,102,117,110,99,116,105,111,110,32,98,111,111,116,40,41,32, +13,10,32,32,32,32,105,102,32,106,105,110,46,102,105,108,101,115,121,115, +116,101,109,46,101,120,105,115,116,40,34,109,97,105,110,46,108,117,97,34, +41,32,116,104,101,110,32,13,10,32,32,32,32,32,32,32,32,99,97,108, +108,40,102,117,110,99,116,105,111,110,40,41,32,13,10,32,32,32,32,32, +32,32,32,32,32,32,32,114,101,113,117,105,114,101,34,109,97,105,110,34, +32,13,10,32,32,32,32,32,32,32,32,32,32,32,32,106,105,110,46,99, +111,114,101,46,114,117,110,40,41,13,10,32,32,32,32,32,32,32,32,101, +110,100,41,13,10,32,32,32,32,101,108,115,101,13,10,32,32,32,32,32, +32,32,32,110,111,71,97,109,101,40,41,13,10,32,32,32,32,101,110,100, +13,10,101,110,100,13,10,13,10,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,13,10,45,45,32,73,110,105,116,105,97,108,105,122,101,32,115,117, +98,32,115,121,115,116,101,109,115,13,10,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,13,10,13,10,106,105,110,46,97,117,100,105,111,46,105,110,105,116, -40,41,13,10,106,105,110,46,103,114,97,112,104,105,99,115,46,105,110,105, -116,40,106,105,110,46,99,111,110,102,105,103,41,13,10,13,10,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,13,10,13,10,106,105,110,46,97,117,100,105,111,46,105,110, +105,116,40,41,13,10,106,105,110,46,103,114,97,112,104,105,99,115,46,105, +110,105,116,40,106,105,110,46,99,111,110,102,105,103,41,13,10,13,10,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,13,10,45,45,32,66,111,111,116,32, -103,97,109,101,13,10,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,13, -10,13,10,120,112,99,97,108,108,40,98,111,111,116,44,32,111,110,69,114, -114,111,114,41,13,10,13,10,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,13,10,45,45,32,66,111,111, +116,32,103,97,109,101,13,10,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,13,10,45,45,32,68,101,115,116,114,111,121,32,115,117,98,45,115,121, -115,116,101,109,115,13,10,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,13,10,13,10,120,112,99,97,108,108,40,98,111,111,116,44,32,111,110, +69,114,114,111,114,41,13,10,13,10,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -13,10,13,10,106,105,110,46,103,114,97,112,104,105,99,115,46,100,101,115, -116,114,111,121,40,41,13,10,106,105,110,46,97,117,100,105,111,46,100,101, -115,116,114,111,121,40,41,13,10,13,10,45,45,45,45,45,45,45,45,45, +45,45,45,13,10,45,45,32,68,101,115,116,114,111,121,32,115,117,98,45, +115,121,115,116,101,109,115,13,10,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,13,10,13,10,106,105,110,46,103,114,97,112,104,105,99,115,46,100, +101,115,116,114,111,121,40,41,13,10,106,105,110,46,97,117,100,105,111,46, +100,101,115,116,114,111,121,40,41,13,10,13,10,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,13,10,45,45,32,81,117,105,116,32,103,97,109,101,13,10, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, +45,45,45,45,45,45,13,10,45,45,32,81,117,105,116,32,103,97,109,101, +13,10,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, 45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45, -45,45,45,45,45,45,45,45,45,45,45,45,45,13,10,13,10,106,105,110, -46,99,111,114,101,46,113,117,105,116,40,41,13,10 +45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,13,10,13,10,106, +105,110,46,99,111,114,101,46,113,117,105,116,40,41,13,10 }; diff --git a/src/libjin-lua/embed/graphics.lua.h b/src/libjin-lua/embed/graphics.lua.h index 463e08d..9e4c5d5 100644 --- a/src/libjin-lua/embed/graphics.lua.h +++ b/src/libjin-lua/embed/graphics.lua.h @@ -1,5 +1,5 @@ /*Auto generated, don't modify by hand.*/ -static unsigned char graphics_lua[] = { +static char graphics_lua[] = { 13,10,106,105,110,46,103,114,97,112,104,105,99,115,32,61,32,106,105,110, 46,103,114,97,112,104,105,99,115,32,111,114,32,123,125,32,13,10,13,10, 108,111,99,97,108,32,106,103,32,61,32,106,105,110,46,103,114,97,112,104, diff --git a/src/libjin-lua/embed/embed.h b/src/libjin-lua/embed/je_lua_embed.h index d67bedf..199de49 100644 --- a/src/libjin-lua/embed/embed.h +++ b/src/libjin-lua/embed/je_lua_embed.h @@ -12,8 +12,7 @@ namespace JinEngine // Embed structure. struct jin_Embed { - const char* file; - const unsigned char* source; + const char* file, *source; }; // Embed scripts. @@ -25,9 +24,9 @@ namespace JinEngine // In order. static const jin_Embed modules[] = { - { "graphics.lua", graphics_lua }, { "keyboard.lua", keyboard_lua }, { "mouse.lua", mouse_lua }, + { "graphics.lua", graphics_lua }, { "path.lua", path_lua }, { 0, 0 } }; @@ -36,18 +35,32 @@ namespace JinEngine static void run(lua_State* L) { + jin_log_info("Load embeded scripts."); const char* file, *source; - for (int i = 0; modules[i].file; ++i) + for (int i = 0; modules[i].file != 0; ++i) { - file = (const char*)modules[i].file; - source = (const char*)modules[i].source; + file = modules[i].file; + source = modules[i].source; + jin_log_info("Embed script \"%s\".", file); + luax_clearstack(L); if (luax_loadbuffer(L, source, strlen(source), file) == 0) + { luax_call(L, 0, 0); + jin_log_info("Done."); + } + else + { + jin_log_error("Embed script \"%s\" failed.", file); + } } - file = (const char*)bootscript.file; - source = (const char*)bootscript.source; + file = bootscript.file; + source = bootscript.source; + jin_log_info("Run boot script \"%s\".", file); + luax_clearstack(L); if (luax_loadbuffer(L, source, strlen(source), file) == 0) + { luax_call(L, 0, 0); + } } } // namespace Embed diff --git a/src/libjin-lua/embed/keyboard.lua.h b/src/libjin-lua/embed/keyboard.lua.h index 61a2ec8..55f8016 100644 --- a/src/libjin-lua/embed/keyboard.lua.h +++ b/src/libjin-lua/embed/keyboard.lua.h @@ -1,14 +1,14 @@ /*Auto generated, don't modify by hand.*/ -static unsigned char keyboard_lua[] = { -106,105,110,46,107,101,121,98,111,97,114,100,32,61,32,106,105,110,46,107, -101,121,98,111,97,114,100,32,111,114,32,123,125,32,13,10,13,10,108,111, -99,97,108,32,107,101,121,115,32,61,32,123,125,32,13,10,13,10,102,117, -110,99,116,105,111,110,32,106,105,110,46,107,101,121,98,111,97,114,100,46, -105,115,80,114,101,115,115,101,100,40,107,41,32,13,10,32,32,32,32,114, -101,116,117,114,110,32,107,101,121,115,91,107,93,13,10,101,110,100,32,32, -13,10,13,10,102,117,110,99,116,105,111,110,32,106,105,110,46,107,101,121, -98,111,97,114,100,46,115,101,116,40,107,44,32,115,116,97,116,117,115,41, -32,13,10,32,32,32,32,107,101,121,115,91,107,93,32,61,32,115,116,97, -116,117,115,32,13,10,101,110,100,32,13,10 +static char keyboard_lua[] = { +13,10,106,105,110,46,107,101,121,98,111,97,114,100,32,61,32,106,105,110, +46,107,101,121,98,111,97,114,100,32,111,114,32,123,125,32,13,10,13,10, +108,111,99,97,108,32,107,101,121,115,32,61,32,123,125,32,13,10,13,10, +102,117,110,99,116,105,111,110,32,106,105,110,46,107,101,121,98,111,97,114, +100,46,105,115,80,114,101,115,115,101,100,40,107,41,32,13,10,32,32,32, +32,114,101,116,117,114,110,32,107,101,121,115,91,107,93,13,10,101,110,100, +32,32,13,10,13,10,102,117,110,99,116,105,111,110,32,106,105,110,46,107, +101,121,98,111,97,114,100,46,115,101,116,40,107,44,32,115,116,97,116,117, +115,41,32,13,10,32,32,32,32,107,101,121,115,91,107,93,32,61,32,115, +116,97,116,117,115,32,13,10,101,110,100,32,13,10 }; diff --git a/src/libjin-lua/embed/mouse.lua.h b/src/libjin-lua/embed/mouse.lua.h index e8caba2..225c4d0 100644 --- a/src/libjin-lua/embed/mouse.lua.h +++ b/src/libjin-lua/embed/mouse.lua.h @@ -1,14 +1,14 @@ /*Auto generated, don't modify by hand.*/ -static unsigned char mouse_lua[] = { -106,105,110,46,109,111,117,115,101,32,61,32,106,105,110,46,109,111,117,115, -101,32,111,114,32,123,125,32,13,10,13,10,108,111,99,97,108,32,98,117, -116,116,111,110,32,61,32,123,125,32,13,10,13,10,102,117,110,99,116,105, -111,110,32,106,105,110,46,109,111,117,115,101,46,105,115,68,111,119,110,40, -98,116,110,41,32,13,10,32,32,32,32,114,101,116,117,114,110,32,98,117, -116,116,111,110,91,98,116,110,93,13,10,101,110,100,32,13,10,13,10,102, -117,110,99,116,105,111,110,32,106,105,110,46,109,111,117,115,101,46,115,101, -116,40,98,116,110,44,32,115,116,97,116,117,115,41,32,13,10,32,32,32, -32,98,117,116,116,111,110,91,98,116,110,93,32,61,32,115,116,97,116,117, -115,13,10,101,110,100,32,13,10 +static char mouse_lua[] = { +13,10,106,105,110,46,109,111,117,115,101,32,61,32,106,105,110,46,109,111, +117,115,101,32,111,114,32,123,125,32,13,10,13,10,108,111,99,97,108,32, +98,117,116,116,111,110,32,61,32,123,125,32,13,10,13,10,102,117,110,99, +116,105,111,110,32,106,105,110,46,109,111,117,115,101,46,105,115,68,111,119, +110,40,98,116,110,41,32,13,10,32,32,32,32,114,101,116,117,114,110,32, +98,117,116,116,111,110,91,98,116,110,93,13,10,101,110,100,32,13,10,13, +10,102,117,110,99,116,105,111,110,32,106,105,110,46,109,111,117,115,101,46, +115,101,116,40,98,116,110,44,32,115,116,97,116,117,115,41,32,13,10,32, +32,32,32,98,117,116,116,111,110,91,98,116,110,93,32,61,32,115,116,97, +116,117,115,13,10,101,110,100,32,13,10 }; diff --git a/src/libjin-lua/embed/net.lua.h b/src/libjin-lua/embed/net.lua.h index acd18bc..eebafbf 100644 --- a/src/libjin-lua/embed/net.lua.h +++ b/src/libjin-lua/embed/net.lua.h @@ -1,5 +1,5 @@ /*Auto generated, don't modify by hand.*/ -static unsigned char net_lua[] = { +static char net_lua[] = { 13,10,106,105,110,46,110,101,116,32,61,32,106,105,110,46,110,101,116,32, 111,114,32,123,125,32,13,10,13,10,108,111,99,97,108,32,106,110,32,61, 32,106,105,110,46,110,101,116,13,10 diff --git a/src/libjin-lua/embed/path.lua.h b/src/libjin-lua/embed/path.lua.h index e342938..b989df0 100644 --- a/src/libjin-lua/embed/path.lua.h +++ b/src/libjin-lua/embed/path.lua.h @@ -1,15 +1,14 @@ /*Auto generated, don't modify by hand.*/ -static unsigned char path_lua[] = { -106,105,110,46,112,97,116,104,32,61,32,106,105,110,46,112,97,116,104,32, -111,114,32,123,125,32,13,10,13,10,108,111,99,97,108,32,106,112,32,61, -32,106,105,110,46,112,97,116,104,13,10,13,10,45,45,32,71,97,109,101, -32,114,111,111,116,32,100,105,114,101,99,116,111,114,121,46,13,10,106,105, -110,46,99,119,100,32,61,32,106,105,110,46,97,114,103,115,91,39,99,119, -100,39,93,32,111,114,32,39,46,39,32,13,10,13,10,45,45,32,71,101, -116,32,102,117,108,108,32,112,97,116,104,32,111,102,32,97,32,103,105,118, -101,110,32,112,97,116,104,46,13,10,102,117,110,99,116,105,111,110,32,106, -105,110,46,112,97,116,104,46,102,117,108,108,40,112,97,116,104,41,13,10, -32,32,32,32,114,101,116,117,114,110,32,106,105,110,46,99,119,100,32,46, -46,32,39,47,39,32,46,46,32,112,97,116,104,13,10,101,110,100,13,10 +static char path_lua[] = { +13,10,106,105,110,46,112,97,116,104,32,61,32,106,105,110,46,112,97,116, +104,32,111,114,32,123,125,32,13,10,13,10,45,45,32,71,97,109,101,32, +114,111,111,116,32,100,105,114,101,99,116,111,114,121,46,13,10,106,105,110, +46,99,119,100,32,61,32,106,105,110,46,97,114,103,115,91,39,99,119,100, +39,93,32,111,114,32,39,46,39,32,13,10,13,10,45,45,32,71,101,116, +32,102,117,108,108,32,112,97,116,104,32,111,102,32,97,32,103,105,118,101, +110,32,112,97,116,104,46,13,10,102,117,110,99,116,105,111,110,32,106,105, +110,46,112,97,116,104,46,102,117,108,108,40,112,97,116,104,41,13,10,32, +32,32,32,114,101,116,117,114,110,32,106,105,110,46,99,119,100,32,46,46, +32,39,47,39,32,46,46,32,112,97,116,104,13,10,101,110,100,13,10 }; diff --git a/src/libjin-lua/embed/scripts/app.lua b/src/libjin-lua/embed/scripts/app.lua index 9281584..9492b21 100644 --- a/src/libjin-lua/embed/scripts/app.lua +++ b/src/libjin-lua/embed/scripts/app.lua @@ -1,3 +1,4 @@ + jin.filesystem.init() jin.filesystem.mount(jin.cwd) diff --git a/src/libjin-lua/embed/scripts/keyboard/keyboard.lua b/src/libjin-lua/embed/scripts/keyboard/keyboard.lua index 8e7ab6e..fa42b3a 100644 --- a/src/libjin-lua/embed/scripts/keyboard/keyboard.lua +++ b/src/libjin-lua/embed/scripts/keyboard/keyboard.lua @@ -1,3 +1,4 @@ + jin.keyboard = jin.keyboard or {} local keys = {} diff --git a/src/libjin-lua/embed/scripts/mouse/mouse.lua b/src/libjin-lua/embed/scripts/mouse/mouse.lua index 22183f9..1d3d8df 100644 --- a/src/libjin-lua/embed/scripts/mouse/mouse.lua +++ b/src/libjin-lua/embed/scripts/mouse/mouse.lua @@ -1,3 +1,4 @@ + jin.mouse = jin.mouse or {} local button = {} diff --git a/src/libjin-lua/embed/scripts/path/path.lua b/src/libjin-lua/embed/scripts/path/path.lua index d41c167..c6bcf41 100644 --- a/src/libjin-lua/embed/scripts/path/path.lua +++ b/src/libjin-lua/embed/scripts/path/path.lua @@ -1,6 +1,5 @@ -jin.path = jin.path or {} -local jp = jin.path +jin.path = jin.path or {} -- Game root directory. jin.cwd = jin.args['cwd'] or '.' diff --git a/src/libjin-lua/embed/state_machine.lua.h b/src/libjin-lua/embed/state_machine.lua.h index d9fae08..5c78cd6 100644 --- a/src/libjin-lua/embed/state_machine.lua.h +++ b/src/libjin-lua/embed/state_machine.lua.h @@ -1,5 +1,5 @@ /*Auto generated, don't modify by hand.*/ -static unsigned char state_machine_lua[] = { +static char state_machine_lua[] = { 106,105,110,46,97,105,32,61,32,106,105,110,46,97,105,32,111,114,32,123, 125,32,13,10,13,10,108,111,99,97,108,32,115,116,97,116,101,109,97,99, 104,105,110,101,32,61,32,123,125,13,10,13,10,106,105,110,46,97,105,46, diff --git a/src/libjin-lua/je_lua_jin.cpp b/src/libjin-lua/je_lua_jin.cpp index 8d79415..0796b6f 100644 --- a/src/libjin-lua/je_lua_jin.cpp +++ b/src/libjin-lua/je_lua_jin.cpp @@ -1,7 +1,7 @@ #include "common/je_lua.h" #include "common/je_lua_common.h" #include "modules/je_lua_modules.h" -#include "embed/embed.h" +#include "embed/je_lua_embed.h" #include "je_lua_jin.h" namespace JinEngine @@ -42,6 +42,8 @@ namespace JinEngine // Register jin module, keep it on the top of stack. LUA_EXPORT void open(lua_State* L) { + jin_log_info("Openning jin library."); + luax_globaltable(L, MODULE_NAME); const luax_Str s[] = { @@ -85,10 +87,13 @@ namespace JinEngine // Pop jin table. luax_pop(L, 1); + + jin_log_info("Done."); } LUA_EXPORT void boot(lua_State* L, const char* cwd) { + //luax_clearstack(L); luax_getglobal(L, MODULE_NAME); luax_newtable(L); luax_setfieldstring(L, "cwd", cwd); |