diff options
author | chai <chaifix@163.com> | 2018-05-21 16:02:00 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-05-21 16:02:00 +0800 |
commit | fa234f9663b992cf50bcf865a1cde6845b42193c (patch) | |
tree | 34ecd41b60ef48c960a79a4077e5e0c8536102fd /src/script/embed/embed.h | |
parent | 51ba9cb2a6b0b9395a2912eadeb954c95e4c1d3c (diff) |
修改audio模块
Diffstat (limited to 'src/script/embed/embed.h')
-rw-r--r-- | src/script/embed/embed.h | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/src/script/embed/embed.h b/src/script/embed/embed.h deleted file mode 100644 index 2ef8b75..0000000 --- a/src/script/embed/embed.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef __JIN_LUA_EMBED_H -#define __JIN_LUA_EMBED_H -#include <cstring> - -namespace jin -{ -namespace embed -{ - - /** - * embed lua script to context. - */ -#define embed(L, script, name) \ - if(luaL_loadbuffer(L, script, strlen(script), name) == 0)\ - lua_call(L, 0, 0); - - /** - * embed structure. - */ - struct jin_Embed - { - const char* fname, *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 "debug.lua.h" // debug - #include "boot.lua.h" // boot - - // embed scripts - const jin_Embed scripts[] = { - {"graphics.lua", graphics_lua}, - {"keyboard.lua", keyboard_lua}, - {"mouse.lua", mouse_lua}, - {"debug.lua", debug_lua}, - {"boot.lua", boot_lua}, - {0, 0} - }; - - // load all emebd lua scripts - for (int i = 0; scripts[i].fname; ++i) - embed(L, scripts[i].source, scripts[i].fname); - } -} -} - -#endif
\ No newline at end of file |