From 65bafdc682db46f0f115374ad39f1fbc348832ac Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 20 Aug 2018 11:51:32 +0800 Subject: *update --- src/lua/embed/embed.h | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 src/lua/embed/embed.h (limited to 'src/lua/embed/embed.h') diff --git a/src/lua/embed/embed.h b/src/lua/embed/embed.h deleted file mode 100644 index 18ed1d8..0000000 --- a/src/lua/embed/embed.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef __JIN_LUA_EMBED_H -#define __JIN_LUA_EMBED_H -#include - -namespace jin -{ -namespace embed -{ - - /** - * embed lua script to context. - */ -#define embed(L, script, name)\ - if(luax_loadbuffer(L, script, strlen(script), name) == 0)\ - lua_call(L, 0, 0); - - /** - * embed structure. - */ - struct jin_Embed - { - const char* file, *source; - }; - - static void boot(lua_State* L) - { - // embed scripts - #include "graphics.lua.h" // graphics - #include "keyboard.lua.h" // keyboard - #include "mouse.lua.h" // mouse - #include "boot.lua.h" // boot - - // embed scripts - const jin_Embed scripts[] = { - { "graphics.lua", graphics_lua }, - { "keyboard.lua", keyboard_lua }, - { "mouse.lua", mouse_lua }, - { "boot.lua", boot_lua }, - { 0, 0 } - }; - - // load all emebd lua scripts - for (int i = 0; scripts[i].file; ++i) - embed(L, scripts[i].source, scripts[i].file); - } -} -} - -#endif \ No newline at end of file -- cgit v1.1-26-g67d0