From 731a8ba6e52aa0b000b46c89e414a248e05778ff Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 22 Dec 2018 13:10:45 +0800 Subject: =?UTF-8?q?*=E7=A7=BB=E5=8A=A8embed=20script=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin-lua/embed/je_lua_embed.h | 69 ------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 src/libjin-lua/embed/je_lua_embed.h (limited to 'src/libjin-lua/embed/je_lua_embed.h') diff --git a/src/libjin-lua/embed/je_lua_embed.h b/src/libjin-lua/embed/je_lua_embed.h deleted file mode 100644 index 199de49..0000000 --- a/src/libjin-lua/embed/je_lua_embed.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef __JIN_LUA_EMBED_H__ -#define __JIN_LUA_EMBED_H__ -#include - -#include "../common/je_lua.h" - -namespace JinEngine -{ - namespace Embed - { - - // Embed structure. - struct jin_Embed - { - const char* file, *source; - }; - - // Embed scripts. - #include "graphics.lua.h" - #include "keyboard.lua.h" - #include "mouse.lua.h" - #include "path.lua.h" - #include "app.lua.h" - - // In order. - static const jin_Embed modules[] = { - { "keyboard.lua", keyboard_lua }, - { "mouse.lua", mouse_lua }, - { "graphics.lua", graphics_lua }, - { "path.lua", path_lua }, - { 0, 0 } - }; - - static const jin_Embed bootscript = { "app.lua", app_lua }; - - static void run(lua_State* L) - { - jin_log_info("Load embeded scripts."); - const char* file, *source; - for (int i = 0; modules[i].file != 0; ++i) - { - 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 = 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 -} // namespace JinEngine - -#endif // __JIN_LUA_EMBED_H__ \ No newline at end of file -- cgit v1.1-26-g67d0