diff options
author | chai <chaifix@163.com> | 2018-12-22 12:25:06 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-12-22 12:25:06 +0800 |
commit | 013438437f1f530609578454cf1123a84749f70d (patch) | |
tree | b4bb495e6cf7f1cb81c3765d66c37d0fe3afbf7f /src/libjin-lua/embed/embed.h | |
parent | f319b9646941c8967db7e48079689483e13c00e4 (diff) |
*misc
Diffstat (limited to 'src/libjin-lua/embed/embed.h')
-rw-r--r-- | src/libjin-lua/embed/embed.h | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/src/libjin-lua/embed/embed.h b/src/libjin-lua/embed/embed.h deleted file mode 100644 index d67bedf..0000000 --- a/src/libjin-lua/embed/embed.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef __JIN_LUA_EMBED_H__ -#define __JIN_LUA_EMBED_H__ -#include <cstring> - -#include "../common/je_lua.h" - -namespace JinEngine -{ - namespace Embed - { - - // Embed structure. - struct jin_Embed - { - const char* file; - const unsigned char* 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[] = { - { "graphics.lua", graphics_lua }, - { "keyboard.lua", keyboard_lua }, - { "mouse.lua", mouse_lua }, - { "path.lua", path_lua }, - { 0, 0 } - }; - - static const jin_Embed bootscript = { "app.lua", app_lua }; - - static void run(lua_State* L) - { - const char* file, *source; - for (int i = 0; modules[i].file; ++i) - { - file = (const char*)modules[i].file; - source = (const char*)modules[i].source; - if (luax_loadbuffer(L, source, strlen(source), file) == 0) - luax_call(L, 0, 0); - } - file = (const char*)bootscript.file; - source = (const char*)bootscript.source; - 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 |