aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-12-09 18:26:17 +0800
committerchai <chaifix@163.com>2018-12-09 18:26:17 +0800
commitb1dfdae7a071407ef5e2d56f2203f96e6ba6068d (patch)
treeb26bbed65fd0074178066de89bb197bb2176305b /src
parent7069a62a7984feff85a37f60c67e2a7624241841 (diff)
*misc
Diffstat (limited to 'src')
-rw-r--r--src/jin/main.cpp14
-rw-r--r--src/lua/je_lua_jin.cpp22
2 files changed, 12 insertions, 24 deletions
diff --git a/src/jin/main.cpp b/src/jin/main.cpp
index 0a37b32..91a4e7c 100644
--- a/src/jin/main.cpp
+++ b/src/jin/main.cpp
@@ -3,7 +3,6 @@
#ifdef _WIN32
#include <Windows.h>
- #include <direct.h>
#include <shlobj.h>
#include <wchar.h>
#endif
@@ -14,22 +13,13 @@
using namespace std;
using namespace JinEngine::Filesystem;
-// Load game under cwd.
static void load(const char* cwd)
{
- // Main thread lua runtime.
+ // Main thread lua state.
lua_State* L = luax_newstate();
-
- // Open lua standard module.
luax_openlibs(L);
-
- // Open jin module.
JinEngine::Lua::open(L);
-
- // Boot jin and run it.
JinEngine::Lua::boot(L, cwd);
-
- // Close lua lib.
luax_close(L);
}
@@ -45,7 +35,7 @@ std::string wstrtostr(const std::wstring &wstr)
delete[] szTo;
return strTo;
}
-#endif
+#endif
bool BrowseFolder(string& cwd)
{
diff --git a/src/lua/je_lua_jin.cpp b/src/lua/je_lua_jin.cpp
index e3af169..8d79415 100644
--- a/src/lua/je_lua_jin.cpp
+++ b/src/lua/je_lua_jin.cpp
@@ -39,23 +39,21 @@ namespace JinEngine
return 1;
}
- LUA_IMPLEMENT const luax_Str s[] = {
- { "version", VERSION },
- { "author", AUTHOR },
- { "codename", CODE_NAME },
- { 0, 0 }
- };
-
- LUA_IMPLEMENT const luax_Num n[] = {
- { "revision", REVISION },
- { 0, 0 }
- };
-
// Register jin module, keep it on the top of stack.
LUA_EXPORT void open(lua_State* L)
{
luax_globaltable(L, MODULE_NAME);
+ const luax_Str s[] = {
+ { "version", VERSION },
+ { "author", AUTHOR },
+ { "codename", CODE_NAME },
+ { 0, 0 }
+ };
+ const luax_Num n[] = {
+ { "revision", REVISION },
+ { 0, 0 }
+ };
// Register values.
luax_setfieldstrings(L, s);
luax_setfieldnumbers(L, n);