diff options
author | chai <chaifix@163.com> | 2018-10-20 16:30:20 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-10-20 16:30:20 +0800 |
commit | 3292019e55dd02a96420e72bad88711fd36ef249 (patch) | |
tree | 71c40787654d5219033e095e3cc054eee0cadeef /src/lua/jin.cpp | |
parent | cf68d9f46da1cf20503a7d738da1f43de916004d (diff) |
*注释
Diffstat (limited to 'src/lua/jin.cpp')
-rw-r--r-- | src/lua/jin.cpp | 178 |
1 files changed, 89 insertions, 89 deletions
diff --git a/src/lua/jin.cpp b/src/lua/jin.cpp index fc1e443..4d8837a 100644 --- a/src/lua/jin.cpp +++ b/src/lua/jin.cpp @@ -4,106 +4,106 @@ namespace JinEngine { -namespace Lua -{ + namespace Lua + { - extern int luaopen_core(lua_State* L); - extern int luaopen_graphics(lua_State* L); - extern int luaopen_audio(lua_State* L); - extern int luaopen_net(lua_State* L); - extern int luaopen_event(lua_State* L); - extern int luaopen_time(lua_State* L); - extern int luaopen_mouse(lua_State* L); - extern int luaopen_keyboard(lua_State* L); - extern int luaopen_filesystem(lua_State* L); - extern int luaopen_joypad(lua_State* L); - extern int luaopen_math(lua_State* L); - extern int luaopen_thread(lua_State* L); - extern int luaopen_bit(lua_State* L); + extern int luaopen_core(lua_State* L); + extern int luaopen_graphics(lua_State* L); + extern int luaopen_audio(lua_State* L); + extern int luaopen_net(lua_State* L); + extern int luaopen_event(lua_State* L); + extern int luaopen_time(lua_State* L); + extern int luaopen_mouse(lua_State* L); + extern int luaopen_keyboard(lua_State* L); + extern int luaopen_filesystem(lua_State* L); + extern int luaopen_joypad(lua_State* L); + extern int luaopen_math(lua_State* L); + extern int luaopen_thread(lua_State* L); + extern int luaopen_bit(lua_State* L); - static int l_getversion(lua_State* L) - { - luax_pushstring(L, VERSION); - return 1; - } + static int l_getversion(lua_State* L) + { + luax_pushstring(L, VERSION); + return 1; + } - static int l_getAuthor(lua_State* L) - { - luax_pushstring(L, AUTHOR); - return 1; - } + static int l_getAuthor(lua_State* L) + { + luax_pushstring(L, AUTHOR); + return 1; + } - static int l_getOS(lua_State* L) - { - #ifdef _WIN32 - luax_pushstring(L, "windows"); - #elif defined __unix__ - luax_pushstring(L, "unix"); - #elif defined __APPLE__ - luax_pushstring(L, "macos"); - #endif - return 1; - } + static int l_getOS(lua_State* L) + { + #ifdef _WIN32 + luax_pushstring(L, "windows"); + #elif defined __unix__ + luax_pushstring(L, "unix"); + #elif defined __APPLE__ + luax_pushstring(L, "macos"); + #endif + return 1; + } - static int l_revision(lua_State* L) - { - luax_pushnumber(L, REVISION); - return 1; - } + static int l_revision(lua_State* L) + { + luax_pushnumber(L, REVISION); + return 1; + } - static const luax_Str s[] = { - { "version", VERSION }, - { "author", AUTHOR }, - { "codename", CODE_NAME }, - { 0, 0 } - }; + static const luax_Str s[] = { + { "version", VERSION }, + { "author", AUTHOR }, + { "codename", CODE_NAME }, + { 0, 0 } + }; - static const luax_Num n[] = { - { "revision", REVISION }, - { 0, 0 } - }; + static const luax_Num n[] = { + { "revision", REVISION }, + { 0, 0 } + }; - /* sub modules */ - static const luax_Ref 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 }, - { 0, 0 } - }; + /* sub modules */ + static const luax_Ref 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 }, + { 0, 0 } + }; - /* register jin module, keep it on the top of stack */ - int luaopen_jin(lua_State* L) - { - luax_globaltable(L, MODULE_NAME); + /* register jin module, keep it on the top of stack */ + int luaopen_jin(lua_State* L) + { + luax_globaltable(L, MODULE_NAME); - /* register values */ - luax_setfieldstrings(L, s); - luax_setfieldnumbers(L, n); + /* register values */ + luax_setfieldstrings(L, s); + luax_setfieldnumbers(L, n); - /* register submodules */ - for (int i = 0; mods[i].name; ++i) - { - mods[i].func(L); - luax_setfield(L, -2, mods[i].name); - } + /* register submodules */ + for (int i = 0; mods[i].name; ++i) + { + mods[i].func(L); + luax_setfield(L, -2, mods[i].name); + } - return 1; - } + return 1; + } - void boot(lua_State* L) - { - JinEngine::embed::boot(L); - } + void boot(lua_State* L) + { + JinEngine::embed::boot(L); + } -} // Lua -} // JinEngine
\ No newline at end of file + } // namespace Lua +} // namespace JinEngine
\ No newline at end of file |