diff options
Diffstat (limited to 'src/script/embed/boot.lua.h')
-rw-r--r-- | src/script/embed/boot.lua.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/script/embed/boot.lua.h b/src/script/embed/boot.lua.h index ee1cbd3..afe352a 100644 --- a/src/script/embed/boot.lua.h +++ b/src/script/embed/boot.lua.h @@ -33,8 +33,9 @@ conf.fps = conf.fps or 60 conf.vsync = conf.vsync or false conf.title = conf.title or ("jin v" .. jin.version()) --- init video subsystem +-- initialize subsystems jin.graphics.init(conf) +--jin.audio.init(conf) -- open debug mode, must after jin.graphics.init if jin._argv[3] == '-d' then @@ -73,8 +74,10 @@ function jin.core.run() -- frame controle last = now now = second() - if (now - last) < fsec then - sleep(fsec - now + last) + dt = now - last + if dt < fsec then + sleep(fsec - dt) + dt = fsec end -- handle events @@ -85,10 +88,6 @@ function jin.core.run() end -- update - dt = now - last - if dt < fsec then - dt = fsec - end if onUpdate then onUpdate(dt) end @@ -101,7 +100,7 @@ function jin.core.run() -- custom drawing if onDraw then - onDraw() + onDraw() end -- render debug window |