diff options
author | chai <chaifix@163.com> | 2018-11-22 12:23:12 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-11-22 12:23:12 +0800 |
commit | 7a20483f06624e82feb129c9e4c8fa13881a6a9f (patch) | |
tree | 82707e7546fe14d1b781a2e15f65f6ef976ac322 /src/lua/modules/time/je_lua_time.cpp | |
parent | 7256d216ecf154d6418c1f3b36dd58a2b69b7827 (diff) |
*修改lua bind
Diffstat (limited to 'src/lua/modules/time/je_lua_time.cpp')
-rw-r--r-- | src/lua/modules/time/je_lua_time.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lua/modules/time/je_lua_time.cpp b/src/lua/modules/time/je_lua_time.cpp index 626d843..6ad4935 100644 --- a/src/lua/modules/time/je_lua_time.cpp +++ b/src/lua/modules/time/je_lua_time.cpp @@ -34,8 +34,7 @@ namespace JinEngine LUA_IMPLEMENT int l_newTimer(lua_State* L) { - Proxy* proxy = luax_newinstance(L, Jin_Lua_Timer); - proxy->bind(new Shared<Timer>(new Timer(), Jin_Lua_Timer)); + Proxy* proxy = luax_newinstance(L, Jin_Lua_Timer, new Shared<Timer>(new Timer(), Jin_Lua_Timer)); return 1; } @@ -55,7 +54,7 @@ namespace JinEngine LUA_EXPORT int luaopen_time(lua_State* L) { luaopen_Timer(L); - luaL_Reg f[] = { + luaL_Reg methods[] = { { "second", l_sec }, { "sleep", l_sleep }, { "newTimer", l_newTimer }, @@ -63,7 +62,7 @@ namespace JinEngine { "getDelta", l_getDelta }, { 0, 0 }, }; - luax_newlib(L, f); + luax_newlib(L, methods); return 1; } |