aboutsummaryrefslogtreecommitdiff
path: root/src/lua/embed/embed.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-10-25 14:09:27 +0800
committerchai <chaifix@163.com>2018-10-25 14:09:27 +0800
commitd703eacde8198433d6b9acf59a98db183e1d6b64 (patch)
tree83cefc9db4f352e2620cf7da934e465bd4e39712 /src/lua/embed/embed.h
parentda468fea0405e1935325d75029b2fdebdfcfbd33 (diff)
*格式化代码
Diffstat (limited to 'src/lua/embed/embed.h')
-rw-r--r--src/lua/embed/embed.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/lua/embed/embed.h b/src/lua/embed/embed.h
index 18373c8..e343dcd 100644
--- a/src/lua/embed/embed.h
+++ b/src/lua/embed/embed.h
@@ -4,28 +4,26 @@
namespace JinEngine
{
-namespace embed
-{
+ namespace embed
+ {
-#define embed(L, script, name)\
- if(luax_loadbuffer(L, script, strlen(script), name) == 0)\
- lua_call(L, 0, 0);
+ #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;
- };
+ /**
+ * embed structure.
+ */
+ struct jin_Embed
+ {
+ const char* file, *source;
+ };
- static void boot(lua_State* L)
- {
// embed scripts
- #include "graphics.lua.h"
- #include "keyboard.lua.h"
- #include "mouse.lua.h"
- #include "boot.lua.h"
+ #include "graphics.lua.h"
+ #include "keyboard.lua.h"
+ #include "mouse.lua.h"
+ #include "boot.lua.h"
// in order
const jin_Embed scripts[] = {
@@ -36,11 +34,13 @@ namespace embed
{ 0, 0 }
};
- for (int i = 0; scripts[i].file; ++i)
- embed(L, scripts[i].source, scripts[i].file);
- }
+ static void boot(lua_State* L)
+ {
+ for (int i = 0; scripts[i].file; ++i)
+ embed(L, scripts[i].source, scripts[i].file);
+ }
-} // embed
+ } // embed
} // namespace JinEngine
#endif \ No newline at end of file