From 6a6ff1891664b613edb2fdf3d23942025a47dcc5 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 6 Aug 2022 09:35:42 -0700 Subject: [PATCH] hardcode some assumptions about how this app uses love --- app.lua | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/app.lua b/app.lua index 1fa94ba..4ff1166 100644 --- a/app.lua +++ b/app.lua @@ -16,10 +16,10 @@ function love.run() --? print('==') App.disable_tests() - if App.initialize_globals then App.initialize_globals() end - if App.initialize then App.initialize(love.arg.parseGameArguments(arg), arg) end - if love.timer then love.timer.step() end + App.initialize_globals() + App.initialize(love.arg.parseGameArguments(arg), arg) + love.timer.step() local dt = 0 return function() @@ -35,22 +35,15 @@ function love.run() end end - -- perform draw before update to give it a chance to mutate state + -- draw before update to give it a chance to mutate state + love.graphics.origin() + love.graphics.clear(love.graphics.getBackgroundColor()) + App.draw() + love.graphics.present() - if love.graphics and love.graphics.isActive() then - love.graphics.origin() - love.graphics.clear(love.graphics.getBackgroundColor()) - - if App.draw then App.draw() end - - love.graphics.present() - end - - if love.timer then dt = love.timer.step() end - - if App.update then App.update(dt) end -- will pass 0 if love.timer is disabled - - if love.timer then love.timer.sleep(0.001) end + dt = love.timer.step() + App.update(dt) + love.timer.sleep(0.001) end end