define App.run_frame at the top level

akkartik
Dec 12, 2024, 5:10 AM
EZZWF7WPG3ZYTBMYCLIQJYPNPRGGQHLBRQMIM2R2AWLZY7EGQR6AC

Dependencies

  • [2] BQH7ANWM resolve conflicts
  • [3] 7UUGFVEQ resolve conflicts
  • [4] ULKNZUZK resolve conflicts
  • [5] DJSIRUMD a more radical attempt at ignoring nil y's
  • [6] CUFW4EJL reorganize app.lua and its comments
  • [7] NLU6BXIR clean up some cruft from error callstacks
  • [8] 3QNOKBFM beginnings of a test harness
  • [9] AGJXIDOF hardcode some assumptions about how this app uses love
  • [10] R6MB3UPB Merge text.love
  • [11] KRLRRLVG Merge text.love
  • [12] AFZEVZOU resolve conflicts
  • [13] AVTNUQYR basic test-enabled framework
  • [14] DMS3N5YD undo an ancient hack; be an idiomatic LÖVE app
  • [15] TBWAE64A app is now live, can communicate with driver
  • [16] IZGZEWFG switch to source editor on error

Change contents

  • replacement in app.lua at line 160
    [5.187][5.799:925](),[5.925][5.207:428](),[5.207][5.207:428]()
    -- one iteration of the event loop
    -- return nil to continue the event loop, non-nil to quit
    App.run_frame = function()
    if love.event then
    love.event.pump()
    for name, a,b,c,d,e,f in love.event.poll() do
    if name == "quit" then
    if not love.quit or not love.quit() then
    return a or 0
    end
    [5.187]
    [5.428]
    -- protect against runtime errors
    return function()
    local status, result = xpcall(App.run_frame, live.handle_error)
    return result
    end
    end
    App = {}
    -- one iteration of the event loop
    -- return nil to continue the event loop, non-nil to quit
    App.run_frame = function()
    if love.event then
    love.event.pump()
    for name, a,b,c,d,e,f in love.event.poll() do
    if name == "quit" then
    if not love.quit or not love.quit() then
    return a or 0
  • edit in app.lua at line 179
    [5.440][5.17:58]()
    love.handlers[name](a,b,c,d,e,f)
  • edit in app.lua at line 180
    [5.491]
    [5.491]
    love.handlers[name](a,b,c,d,e,f)
  • edit in app.lua at line 182
    [5.499]
    [5.550]
    end
  • replacement in app.lua at line 184
    [5.551][5.32:59](),[5.59][5.59:78](),[5.78][5.78:79](),[5.235][5.78:79](),[5.78][5.78:79](),[5.79][5.186:273](),[5.186][5.186:273](),[5.273][5.79:94](),[5.94][5.288:316](),[5.271][5.288:316](),[5.288][5.288:316]()
    dt = love.timer.step()
    App.update(dt)
    love.graphics.origin()
    love.graphics.clear(love.graphics.getBackgroundColor())
    App.draw()
    love.graphics.present()
    [5.551]
    [5.636]
    dt = love.timer.step()
    App.update(dt)
  • replacement in app.lua at line 187
    [5.363][5.363:391]()
    love.timer.sleep(0.001)
    [5.637]
    [5.926]
    love.graphics.origin()
    love.graphics.clear(love.graphics.getBackgroundColor())
    App.draw()
    love.graphics.present()
  • replacement in app.lua at line 192
    [5.927][5.927:973]()
    -- returning nil continues the loop
    end
    [5.927]
    [5.973]
    love.timer.sleep(0.001)
  • replacement in app.lua at line 194
    [5.974][5.974:1116](),[5.920][5.920:926]()
    -- protect against runtime errors
    return function()
    local status, result = xpcall(App.run_frame, live.handle_error)
    return result
    end
    [5.974]
    [5.1035]
    -- returning nil continues the loop
  • edit in app.lua at line 204
    [4.962][4.962:972]()
    App = {}