aboutsummaryrefslogtreecommitdiff
path: root/src/lua/embed/embed.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/embed/embed.h')
-rw-r--r--src/lua/embed/embed.h46
1 files changed, 22 insertions, 24 deletions
diff --git a/src/lua/embed/embed.h b/src/lua/embed/embed.h
index 18373c8..054672c 100644
--- a/src/lua/embed/embed.h
+++ b/src/lua/embed/embed.h
@@ -4,30 +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"
+ // Embed scripts.
+ #include "scripts/graphics.lua.h"
+ #include "scripts/keyboard.lua.h"
+ #include "scripts/mouse.lua.h"
+ #include "scripts/boot.lua.h"
- // in order
+ // In order.
const jin_Embed scripts[] = {
{ "graphics.lua", graphics_lua },
{ "keyboard.lua", keyboard_lua },
@@ -36,11 +32,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
+ } // namespace Embed
} // namespace JinEngine
#endif \ No newline at end of file