Skip to content

Commit 3cb0cd1

Browse files
committed
修复love.run执行前发生错误导致没初始化SCR相关坐标系然后错误界面一片蓝
整理代码
1 parent febcda7 commit 3cb0cd1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

init.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ local KBisDown=kb.isDown
1212

1313
local gc=love.graphics
1414
local gc_replaceTransform,gc_translate,gc_present=gc.replaceTransform,gc.translate,gc.present
15-
local gc_clear,gc_discard=gc.clear,gc.discard
1615
local gc_setColor,gc_circle=gc.setColor,gc.circle
1716
local gc_print,gc_printf=gc.print,gc.printf
1817

@@ -629,7 +628,7 @@ function love.errorhandler(msg)
629628
SCR.resize(a,b)
630629
end
631630
end
632-
gc_clear(.3,.5,.9)
631+
GC.clear(.3,.5,.9)
633632
GC.push('transform')
634633
GC.replaceTransform(SCR.origin)
635634
local k=math.min(SCR.h/720,1)
@@ -826,7 +825,7 @@ function love.run()
826825
gc_present()
827826

828827
-- SPEED UPUP! (probably not that obvious)
829-
if discardCanvas then gc_discard() end
828+
if discardCanvas then GC.discard() end
830829
end
831830
end
832831

@@ -959,6 +958,7 @@ end
959958

960959
--------------------------------------------------------------
961960

961+
SCR.resize(gc.getWidth(),gc.getHeight())
962962
SCN.add('_quit',{enter=function() onQuit() love.event.quit() end})
963963
SCN.add('_console',require'Zenitha/scene/console')
964964
SCN.add('_zenitha',require'Zenitha/scene/demo')

0 commit comments

Comments
 (0)