From 3260afcac26fdad2e217deb1e60581366e69f9be Mon Sep 17 00:00:00 2001 From: MrZ_26 Date: Wed, 29 Jul 2020 02:33:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=A7=E7=8E=87=E6=8E=A7=E5=88=B6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=8D=A2=E5=9B=9E=E4=B9=8B=E5=89=8D=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/init.lua | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/Zframework/init.lua b/Zframework/init.lua index f91ca45f..854d81da 100644 --- a/Zframework/init.lua +++ b/Zframework/init.lua @@ -1100,18 +1100,17 @@ function love.run() --Debug info. if devMode then gc.setColor(devColor[devMode]) - gc.print("Cache used:"..gcinfo(),5,_-20) - gc.print("Free Row:"..freeRow.getCount(),5,_-40) - gc.print("Mouse:"..mx.." "..my,5,_-60) + gc.print("Memory:"..gcinfo(),5,_-20) + gc.print("Lines:"..freeRow.getCount(),5,_-40) + gc.print("Cursor:"..mx.." "..my,5,_-60) gc.print("Voices:"..VOC.getCount(),5,_-80) gc.print("Tasks:"..TASK.getCount(),5,_-100) - ins(LIST,1,dt) - rem(LIST,126) + ins(LIST,1,dt)rem(LIST,126) for i=1,#LIST do gc.rectangle("fill",900+2*i,_,2,-LIST[i]*4000) end - if devMode==3 then love.timer.sleep(.26) - elseif devMode==4 then love.timer.sleep(.626) + if devMode==3 then WAIT(.26) + elseif devMode==4 then WAIT(.626) end end @@ -1119,15 +1118,14 @@ function love.run() end end - --Keep 60fps - if FPS()>61 then - WAIT(1/60+lastFrame-Timer()) - end - --Fresh power info. if Timer()-lastFreshPow>3 and setting.powerInfo and SCN.cur~="load"then updatePowerInfo() lastFreshPow=Timer() end + + --Keep 60fps + if Timer()-lastFrame<.005 then WAIT(.01)end + while Timer()-lastFrame<.0159 do WAIT(.001)end end end \ No newline at end of file