aboutsummaryrefslogtreecommitdiff
path: root/src/lua/jin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/jin.cpp')
-rw-r--r--src/lua/jin.cpp47
1 files changed, 23 insertions, 24 deletions
diff --git a/src/lua/jin.cpp b/src/lua/jin.cpp
index 186b9b2..d9f685b 100644
--- a/src/lua/jin.cpp
+++ b/src/lua/jin.cpp
@@ -64,39 +64,38 @@ namespace JinEngine
{ 0, 0 }
};
- /* sub modules */
- LUA_IMPLEMENT const luax_Reg mods[] = {
- { "core", luaopen_core },
- { "event", luaopen_event },
- { "graphics", luaopen_graphics },
- { "time", luaopen_time },
- { "mouse", luaopen_mouse },
- { "keyboard", luaopen_keyboard },
- { "filesystem", luaopen_filesystem },
- { "net", luaopen_net },
- { "audio", luaopen_audio },
- { "joypad", luaopen_joypad },
- { "math", luaopen_math },
- { "thread", luaopen_thread },
- { "bit", luaopen_bit },
- //{"ai", luaopen_ai },
- { 0, 0 }
- };
-
/* register jin module, keep it on the top of stack */
LUA_EXPORT int luaopen_jin(lua_State* L)
{
luax_globaltable(L, MODULE_NAME);
- /* register values */
+ // Register values.
luax_setfieldstrings(L, s);
luax_setfieldnumbers(L, n);
- /* register submodules */
- for (int i = 0; mods[i].name; ++i)
+ luax_Reg modules[] = {
+ { "core", luaopen_core },
+ { "event", luaopen_event },
+ { "graphics", luaopen_graphics },
+ { "time", luaopen_time },
+ { "mouse", luaopen_mouse },
+ { "keyboard", luaopen_keyboard },
+ { "filesystem", luaopen_filesystem },
+ { "net", luaopen_net },
+ { "audio", luaopen_audio },
+ { "joypad", luaopen_joypad },
+ { "math", luaopen_math },
+ { "thread", luaopen_thread },
+ { "bit", luaopen_bit },
+ //{"ai", luaopen_ai },
+ { 0, 0 }
+ };
+
+ // Register sub modules.
+ for (int i = 0; modules[i].name; ++i)
{
- mods[i].func(L);
- luax_setfield(L, -2, mods[i].name);
+ modules[i].func(L);
+ luax_setfield(L, -2, modules[i].name);
}
return 1;