aboutsummaryrefslogtreecommitdiff
path: root/src/jin/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/jin/main.cpp')
-rw-r--r--src/jin/main.cpp14
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