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/audio/je_lua_audio.cpp | |
parent | 7256d216ecf154d6418c1f3b36dd58a2b69b7827 (diff) |
*修改lua bind
Diffstat (limited to 'src/lua/modules/audio/je_lua_audio.cpp')
-rw-r--r-- | src/lua/modules/audio/je_lua_audio.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/lua/modules/audio/je_lua_audio.cpp b/src/lua/modules/audio/je_lua_audio.cpp index b9183b2..61b9556 100644 --- a/src/lua/modules/audio/je_lua_audio.cpp +++ b/src/lua/modules/audio/je_lua_audio.cpp @@ -1,5 +1,4 @@ -#include "LuaJIT/lua.hpp" -#include "libraries/luax/luax.h" +#include "common/je_lua.h" #include "common/je_lua_common.h" #include "libjin/jin.h" #include "je_lua_source.h" @@ -98,8 +97,7 @@ namespace JinEngine luax_pushnil(L); return 1; } - Proxy* proxy = luax_newinstance(L, Jin_Lua_Source); - proxy->bind(new Shared<Source>(src, Jin_Lua_Source)); + Proxy* proxy = luax_newinstance(L, Jin_Lua_Source, new Shared<Source>(src, Jin_Lua_Source)); return 1; } @@ -114,7 +112,7 @@ namespace JinEngine { luaopen_Source(L); - luaL_Reg f[] = { + luaL_Reg methods[] = { { "init", l_init }, { "play", l_play }, { "stop", l_stop }, @@ -125,9 +123,7 @@ namespace JinEngine { "destroy", l_destroy }, { 0, 0 } }; - - luax_newlib(L, f); - + luax_newlib(L, methods); return 1; } |