diff options
Diffstat (limited to 'src/lua/embed')
-rw-r--r-- | src/lua/embed/boot.lua.h | 3 | ||||
-rw-r--r-- | src/lua/embed/graphics.lua.h | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/lua/embed/boot.lua.h b/src/lua/embed/boot.lua.h index 35606af..99e657b 100644 --- a/src/lua/embed/boot.lua.h +++ b/src/lua/embed/boot.lua.h @@ -40,6 +40,7 @@ end function jin.core.run() call(jin.core.onLoad) + jin.graphics.reset() local dt = 0 local previous = jin.time.second() local current = previous @@ -138,9 +139,9 @@ jin.nogame = { ------------------------------------------------------------------------- local function onError(msg) + jin.graphics.reset() jin.graphics.setClearColor(100, 100, 100, 255) 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 diff --git a/src/lua/embed/graphics.lua.h b/src/lua/embed/graphics.lua.h index 288d2f4..5fa5dad 100644 --- a/src/lua/embed/graphics.lua.h +++ b/src/lua/embed/graphics.lua.h @@ -35,4 +35,12 @@ jin.graphics.unuseShader = function() jin.graphics.useShader(default_shader) end +-- Reset all attributes to default value. +jin.graphics.reset = function() + jin.graphics.setColor(255, 255, 255, 255) + jin.graphics.setClearColor(0, 0, 0, 255) + jin.graphics.clear() + jin.graphics.unsetFont() +end + )"; |