diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-08-06 09:35:42 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-08-06 09:51:32 -0700 |
commit | 6a6ff1891664b613edb2fdf3d23942025a47dcc5 (patch) | |
tree | 5fcfcd40fa2a838dc316299dc6d9c8c6d1642c64 /app.lua | |
parent | 65879591caaeadaa884a8223a255835bbef0f394 (diff) | |
download | text.love-6a6ff1891664b613edb2fdf3d23942025a47dcc5.tar.gz |
hardcode some assumptions about how this app uses love
Diffstat (limited to 'app.lua')
-rw-r--r-- | app.lua | 29 |
1 files 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 - - 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 + -- 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.timer then love.timer.sleep(0.001) end + dt = love.timer.step() + App.update(dt) + love.timer.sleep(0.001) end end |