aboutsummaryrefslogtreecommitdiff
path: root/src/lua/embed/scripts/boot.lua.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-11-12 08:04:11 +0800
committerchai <chaifix@163.com>2018-11-12 08:04:11 +0800
commit72e45f0062d727cedd576d1e1251f6722454a119 (patch)
tree736594b79e71c66a668d99d96c3ce464618e50ca /src/lua/embed/scripts/boot.lua.h
parent7c2f33bdf37de7acf9b0728a115377081344db1c (diff)
*修改代码结构
Diffstat (limited to 'src/lua/embed/scripts/boot.lua.h')
-rw-r--r--src/lua/embed/scripts/boot.lua.h12
1 files changed, 6 insertions, 6 deletions
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()