diff options
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 |