整理代码

This commit is contained in:
MrZ626
2020-12-14 11:27:15 +08:00
parent 1e7ee927c4
commit 7a33814886
2 changed files with 10 additions and 4 deletions

View File

@@ -2,6 +2,7 @@ SCR= require"Zframework/screen"
COLOR= require"Zframework/color"
SCN= require"Zframework/scene"
LOG= require"Zframework/log"
require"Zframework/toolfunc"
VIB= require"Zframework/vibrate"
@@ -71,11 +72,11 @@ local function updatePowerInfo()
gc.draw(IMG.batteryImage,73,3)
end
setFont(25)
gc.print(os.date("%H:%M",os.time()),3,-5)
gc.print(os.date("%H:%M"),3,-5)
gc.pop()gc.setCanvas()
end
-------------------------------------------------------------
local lastX,lastY=0,0--Last clickDown pos
local lastX,lastY=0,0--Last click pos
function love.mousepressed(x,y,k,touch)
if touch then return end
mouseShow=true
@@ -302,8 +303,13 @@ end
function love.sendData(data)end
function love.receiveData(id,data)end
]]
local lastGCtime=0
function love.lowmemory()
collectgarbage()
if love.timer.getTime()-lastGCtime>2.6 then
lastGCtime=love.timer.getTime
collectgarbage()
LOG.print("[Auto GC] Low Memory!","warn")
end
end
function love.resize(w,h)
SCR.resize(w,h)

View File

@@ -55,7 +55,7 @@ function LOG.print(text,T,C)--text,type/time,color
C=C or COLOR.white
time=T
elseif type(T)=="table"then
C,T=T
C=T
elseif not C then
C=COLOR.white
end