diff options
author | chai <chaifix@163.com> | 2018-05-20 23:37:11 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-05-20 23:37:11 +0800 |
commit | 51ba9cb2a6b0b9395a2912eadeb954c95e4c1d3c (patch) | |
tree | 58ce7d8b50c0d9a451d26bf0b3230b1c2e2f2782 /src/script/core/luaopen_core.cpp | |
parent | adfda73e1810973a40b7bedd9a8edc3e7ab89e3c (diff) |
修改目录结构
Diffstat (limited to 'src/script/core/luaopen_core.cpp')
-rw-r--r-- | src/script/core/luaopen_core.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/script/core/luaopen_core.cpp b/src/script/core/luaopen_core.cpp index 0d76ada..a222013 100644 --- a/src/script/core/luaopen_core.cpp +++ b/src/script/core/luaopen_core.cpp @@ -11,7 +11,7 @@ namespace lua { bool running = Game::get()->running(); luax_pushboolean(L, running); - return 1; + return 1; } static int l_quit(lua_State* L) @@ -19,10 +19,17 @@ namespace lua Game::get()->quit(); return 0; } + + static int l_exit(lua_State* L) + { + Game::get()->exit(); + return 0; + } static const luaL_Reg f[] = { {"running", l_running}, - {"quit", l_quit}, + {"quit", l_quit}, // for end game loop + {"exit", l_exit}, // for exit whole game {0, 0} }; |