hardcode some assumptions about how this app uses love
This commit is contained in:
parent
65879591ca
commit
6a6ff18916
29
app.lua
29
app.lua
|
@ -16,10 +16,10 @@ function love.run()
|
||||||
|
|
||||||
--? print('==')
|
--? print('==')
|
||||||
App.disable_tests()
|
App.disable_tests()
|
||||||
if App.initialize_globals then App.initialize_globals() end
|
App.initialize_globals()
|
||||||
if App.initialize then App.initialize(love.arg.parseGameArguments(arg), arg) end
|
App.initialize(love.arg.parseGameArguments(arg), arg)
|
||||||
if love.timer then love.timer.step() end
|
|
||||||
|
|
||||||
|
love.timer.step()
|
||||||
local dt = 0
|
local dt = 0
|
||||||
|
|
||||||
return function()
|
return function()
|
||||||
|
@ -35,22 +35,15 @@ function love.run()
|
||||||
end
|
end
|
||||||
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
|
dt = love.timer.step()
|
||||||
love.graphics.origin()
|
App.update(dt)
|
||||||
love.graphics.clear(love.graphics.getBackgroundColor())
|
love.timer.sleep(0.001)
|
||||||
|
|
||||||
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
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue