框架添加设置最大帧率的入口
This commit is contained in:
@@ -88,6 +88,7 @@ local showPowerInfo=true
|
|||||||
local showClickFX=true
|
local showClickFX=true
|
||||||
local discardCanvas=false
|
local discardCanvas=false
|
||||||
local frameMul=100
|
local frameMul=100
|
||||||
|
local sleepInterval=1/60
|
||||||
local onQuit=NULL
|
local onQuit=NULL
|
||||||
|
|
||||||
local batteryImg=GC.DO{31,20,
|
local batteryImg=GC.DO{31,20,
|
||||||
@@ -821,10 +822,7 @@ function love.run()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--Keep 60fps
|
WAIT(sleepInterval)
|
||||||
_=timer()-lastFrame
|
|
||||||
if _<.0162 then WAIT(.0162-_)end
|
|
||||||
while timer()-lastFrame<1/60 do end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -844,6 +842,7 @@ end
|
|||||||
function Z.setPowerInfo(bool)showPowerInfo=bool end
|
function Z.setPowerInfo(bool)showPowerInfo=bool end
|
||||||
function Z.setCleanCanvas(bool)discardCanvas=bool end
|
function Z.setCleanCanvas(bool)discardCanvas=bool end
|
||||||
function Z.setFrameMul(n)frameMul=n end
|
function Z.setFrameMul(n)frameMul=n end
|
||||||
|
function Z.setMaxFPS(fps)sleepInterval=1/fps end
|
||||||
function Z.setClickFX(bool)showClickFX=bool end
|
function Z.setClickFX(bool)showClickFX=bool end
|
||||||
|
|
||||||
--[Warning] Color and line width is uncertain value, set it in the function.
|
--[Warning] Color and line width is uncertain value, set it in the function.
|
||||||
|
|||||||
Reference in New Issue
Block a user