diff options
author | chai <chaifix@163.com> | 2018-12-23 14:24:49 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-12-23 14:24:49 +0800 |
commit | d5bd4d53dfcda03558be24e8c353fc042802c085 (patch) | |
tree | a9109b68e529a49314154f5511fe53bb0e74fc0f /src/libjin-lua/modules/time/je_lua_time.cpp | |
parent | 5b8b5c95589e615afda3f0d67db612b64297c2a0 (diff) |
* json\xml扩展
Diffstat (limited to 'src/libjin-lua/modules/time/je_lua_time.cpp')
-rw-r--r-- | src/libjin-lua/modules/time/je_lua_time.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/libjin-lua/modules/time/je_lua_time.cpp b/src/libjin-lua/modules/time/je_lua_time.cpp index 764cf9d..b0468ec 100644 --- a/src/libjin-lua/modules/time/je_lua_time.cpp +++ b/src/libjin-lua/modules/time/je_lua_time.cpp @@ -12,12 +12,6 @@ namespace JinEngine namespace Lua { - static struct - { - float previous; - float current; - } context; - LUA_IMPLEMENT int l_sec(lua_State* L) { luax_pushnumber(L, getSecond()); @@ -40,22 +34,21 @@ namespace JinEngine LUA_IMPLEMENT int l_getDelta(lua_State* L) { - luax_pushnumber(L, context.current - context.previous); + luax_pushnumber(L, Time::getDeltaTime()); return 1; } LUA_IMPLEMENT int l_step(lua_State* L) { - context.previous = context.current; - context.current = getSecond(); - // Update jin time counter. Time::step(); return 0; } LUA_EXPORT int luaopen_time(lua_State* L) { + // Types. luaopen_Timer(L); + // Functions. luaL_Reg methods[] = { { "second", l_sec }, { "sleep", l_sleep }, |