From 99bea1e47c813016d89c9e99296fa66e183d808f Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 22 Oct 2018 08:18:17 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9onerror?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua/embed/boot.lua.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/lua/embed/boot.lua.h') diff --git a/src/lua/embed/boot.lua.h b/src/lua/embed/boot.lua.h index 055a653..35606af 100644 --- a/src/lua/embed/boot.lua.h +++ b/src/lua/embed/boot.lua.h @@ -59,7 +59,7 @@ function jin.core.run() jin.graphics.clear() call(jin.core.onDraw) jin.graphics.present() - -- sleep 1 ms + -- Sleep 1 ms jin.time.sleep(0.001) end end @@ -138,19 +138,19 @@ jin.nogame = { ------------------------------------------------------------------------- local function onError(msg) - print("Error:\n" .. msg) - function jin.core.onEvent(e) - if e.type == "Quit" then - jin.core.stop() - end - end - function jin.core.onDraw() - jin.graphics.unsetFont() - jin.graphics.print("Error:\n" .. msg .. "\n" .. debug.traceback(), 5, 5) - end jin.graphics.setClearColor(100, 100, 100, 255) - jin.core.onLoad = nil - jin.core.run() + jin.graphics.clear() + jin.graphics.unsetFont() + jin.graphics.print("Error:\n" .. msg .. "\n" .. debug.traceback(), 5, 5) + jin.graphics.present() + while jin.core.running() do + for _, e in pairs(jin.event.poll()) do + if e.type == "Quit" then + jin.core.stop() + end + end + jin.time.sleep(0.001) + end jin.core.quit() end -- cgit v1.1-26-g67d0