From 337a776fbb98ad82dd61395a0ffa66aed80c3654 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sun, 21 Feb 2021 21:47:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=86=85=E5=AD=98=E4=B8=8D?= =?UTF-8?q?=E8=B6=B3=E7=9A=84=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/init.lua | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/Zframework/init.lua b/Zframework/init.lua index 192455ba..6809aa54 100644 --- a/Zframework/init.lua +++ b/Zframework/init.lua @@ -327,10 +327,10 @@ function love.receiveData(id,data)end ]] local lastGCtime=0 function love.lowmemory() - if love.timer.getTime()-lastGCtime>2.6 then - lastGCtime=TIME() + if TIME()-lastGCtime>6.26 then collectgarbage() - LOG.print("[Auto GC] Low Memory!","warn") + lastGCtime=TIME() + LOG.print("[auto GC] low memory 设备内存过低","warn") end end function love.resize(w,h) @@ -434,7 +434,6 @@ local devColor={ COLOR.lGreen, COLOR.lBlue, } -local FPS=love.timer.getFPS love.draw,love.update=nil--remove default draw/update function love.run() local SCN=SCN @@ -442,6 +441,7 @@ function love.run() local TIME=TIME local STEP,WAIT=love.timer.step,love.timer.sleep + local FPS=love.timer.getFPS local MINI=love.window.isMinimized local PUMP,POLL=love.event.pump,love.event.poll local DISCARD=gc.discard @@ -456,11 +456,7 @@ function love.run() love.resize(gc.getWidth(),gc.getHeight()) --Scene Launch - if SETTING.appLock then - SCN.init("calculator") - else - SCN.init("load") - end + SCN.init(SETTING.appLock and"calculator"or"load") return function() local _ @@ -574,10 +570,10 @@ function love.run() end --Fresh power info. - if TIME()-lastFreshPow>2.6 then + if t-lastFreshPow>2.6 then if SETTING.powerInfo and LOADED then updatePowerInfo() - lastFreshPow=TIME() + lastFreshPow=t end if gc.getWidth()~=SCR.w then love.resize(gc.getWidth(),gc.getHeight())