mirror of
https://github.com/bjornbytes/lovr.git
synced 2024-07-02 12:33:52 +00:00
Fix some issues with lovr.event.quit('restart');
This commit is contained in:
parent
781a5a7688
commit
0d7810b333
|
@ -32,6 +32,7 @@ int main(int argc, char** argv) {
|
||||||
|
|
||||||
glfwSetErrorCallback(onGlfwError);
|
glfwSetErrorCallback(onGlfwError);
|
||||||
lovrAssert(glfwInit(), "Error initializing GLFW");
|
lovrAssert(glfwInit(), "Error initializing GLFW");
|
||||||
|
glfwSetTime(0);
|
||||||
|
|
||||||
// arg
|
// arg
|
||||||
lua_newtable(L);
|
lua_newtable(L);
|
||||||
|
@ -70,12 +71,9 @@ int main(int argc, char** argv) {
|
||||||
emscripten_set_main_loop_arg(emscriptenLoop, (void*) L, 0, 1);
|
emscripten_set_main_loop_arg(emscriptenLoop, (void*) L, 0, 1);
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
int top = lua_gettop(L);
|
while (lua_resume(L, 0) == LUA_YIELD) ;
|
||||||
while (lua_resume(L, 0) == LUA_YIELD) {
|
|
||||||
lua_settop(L, top);
|
|
||||||
}
|
|
||||||
|
|
||||||
int exitCode = luaL_optint(L, -1, 0);
|
int exitCode = lua_tonumber(L, -1);
|
||||||
bool isRestart = lua_type(L, -1) == LUA_TSTRING && !strcmp(lua_tostring(L, -1), "restart");
|
bool isRestart = lua_type(L, -1) == LUA_TSTRING && !strcmp(lua_tostring(L, -1), "restart");
|
||||||
|
|
||||||
lovrDestroy();
|
lovrDestroy();
|
||||||
|
|
Loading…
Reference in a new issue