aboutsummaryrefslogtreecommitdiff
path: root/src/lua/embed/boot.lua.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua/embed/boot.lua.h')
-rw-r--r--src/lua/embed/boot.lua.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/lua/embed/boot.lua.h b/src/lua/embed/boot.lua.h
index ca08e87..390cb47 100644
--- a/src/lua/embed/boot.lua.h
+++ b/src/lua/embed/boot.lua.h
@@ -21,14 +21,6 @@ jin.config.fullscreen = jin.config.fullscreen or false
jin.config.fps = jin.config.fps or 60
-------------------------------------------------------------------------
--- Initialize sub systems
--------------------------------------------------------------------------
-
-jin.graphics.init(jin.config)
-jin.audio.init()
--- TODO: Disable some internal lua modules.
-
--------------------------------------------------------------------------
-- Default game loop
-------------------------------------------------------------------------
@@ -82,6 +74,7 @@ end
-- Display error message.
local function onError(msg)
+ jin.graphics.init(jin.config)
local err = "Error:\n" .. msg .. "\n" .. debug.traceback()
jin.graphics.reset()
jin.graphics.setClearColor(100, 100, 100, 255)
@@ -94,21 +87,26 @@ end
-- No game screen.
local function noGame()
jin.graphics.reset()
- jin.graphics.reset()
- jin.graphics.setClearColor(100, 100, 100, 255)
jin.graphics.clear()
jin.graphics.print("No Game", 5, 5)
jin.graphics.present()
plainLoop()
end
+-------------------------------------------------------------------------
+-- Initialize sub systems
+-------------------------------------------------------------------------
+
+-- TODO: Disable some internal lua modules.
+
local function boot()
if jin.filesystem.exist("main.lua") then
- call(function()
- require"main"
- jin.core.run()
- end)
+ call(function() require"main" end)
+ jin.graphics.init(jin.config)
+ jin.audio.init()
+ call(jin.core.run)
else
+ jin.graphics.init(jin.config)
noGame()
end
end