diff options
author | chai <chaifix@163.com> | 2018-10-25 08:18:13 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-10-25 08:18:13 +0800 |
commit | 7322a090355af1989d7a1de0de431b6c89844fe2 (patch) | |
tree | c164a05b263007e18cc1c83c8183023d6a19ef82 /src/lua/modules/core | |
parent | f889c9c20fc09f26eb8a70674c1d60181835c38a (diff) |
*增加lua导出宏
Diffstat (limited to 'src/lua/modules/core')
-rw-r--r-- | src/lua/modules/core/je_lua_core.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/lua/modules/core/je_lua_core.cpp b/src/lua/modules/core/je_lua_core.cpp index 1b7d762..0e4cdbb 100644 --- a/src/lua/modules/core/je_lua_core.cpp +++ b/src/lua/modules/core/je_lua_core.cpp @@ -1,3 +1,4 @@ +#include "lua/common/je_lua_common.h" #include "lua/modules/luax.h" #include "libjin/jin.h" @@ -8,34 +9,34 @@ namespace JinEngine using namespace JinEngine::Game; - static int l_running(lua_State* L) + LUA_IMPLEMENT int l_running(lua_State* L) { - static Application* game = Application::get(); - bool running = game->running(); + static Application* app = Application::get(); + bool running = app->running(); luax_pushboolean(L, running); return 1; } - static int l_stop(lua_State* L) + LUA_IMPLEMENT int l_stop(lua_State* L) { Application::get()->stop(); return 0; } - static int l_quit(lua_State* L) + LUA_IMPLEMENT int l_quit(lua_State* L) { Application::get()->quit(); return 0; } - static const luaL_Reg f[] = { + LUA_IMPLEMENT const luaL_Reg f[] = { { "running", l_running }, { "stop", l_stop }, { "quit", l_quit }, { 0, 0 } }; - int luaopen_core(lua_State* L) + LUA_EXPORT int luaopen_core(lua_State* L) { luax_newlib(L, f); |