diff options
author | chai <chaifix@163.com> | 2018-11-23 12:24:22 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-11-23 12:24:22 +0800 |
commit | 8d4e45c9a85175d0fc37d7d5c49ff90abb01fe4f (patch) | |
tree | 4ca2d0b34366293ad57d77c64e753c9013ccdc21 /src/jin/main.cpp | |
parent | cfa05003be67344fbc79c338c2ac82f0accd979d (diff) |
*修改lua bind
Diffstat (limited to 'src/jin/main.cpp')
-rw-r--r-- | src/jin/main.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/jin/main.cpp b/src/jin/main.cpp index fb3876b..31e837f 100644 --- a/src/jin/main.cpp +++ b/src/jin/main.cpp @@ -13,32 +13,24 @@ using namespace std; using namespace JinEngine::Filesystem; -using namespace JinEngine::Lua; // Load game under cwd. static void load(const char* cwd) { - // Global lua runtime. lua_State* L = luax_newstate(); // Open lua standard module. luax_openlibs(L); + // Open jin module. - luaopen_jin(L); - // Set current working directory. - luax_newtable(L); - luax_setfieldstring(L, "cwd", cwd); - luax_setfield(L, -2, "args"); - // Clear lua stack. - luax_clearstack(L); + JinEngine::Lua::open(L); // Boot jin and run it. - boot(L); + JinEngine::Lua::boot(L, cwd); // Close lua lib. luax_close(L); - } #ifdef _WIN32 |