From 72e45f0062d727cedd576d1e1251f6722454a119 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 12 Nov 2018 08:04:11 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua/embed/scripts/boot.lua.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/lua/embed/scripts/boot.lua.h') diff --git a/src/lua/embed/scripts/boot.lua.h b/src/lua/embed/scripts/boot.lua.h index cffeca6..af81c16 100644 --- a/src/lua/embed/scripts/boot.lua.h +++ b/src/lua/embed/scripts/boot.lua.h @@ -31,12 +31,13 @@ local function call(func, ...) end end +local step = jin.time.step +jin.time.step = nil + function jin.core.run() jin.graphics.reset() call(jin.core.onLoad) local dt = 0 - local previous = jin.time.second() - local current = previous while jin.core.running() do for _, e in pairs(jin.event.poll()) do if e.type == "KeyDown" then @@ -46,10 +47,9 @@ function jin.core.run() end call(jin.core.onEvent, e) end - previous = current - current = jin.time.second() - dt = current - previous - call(jin.core.onUpdate, dt) + step() + dt = jin.time.getDelta() + call(jin.core.onUpdate) jin.graphics.clear() call(jin.core.onDraw) jin.graphics.present() -- cgit v1.1-26-g67d0