From 7a20483f06624e82feb129c9e4c8fa13881a6a9f Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 22 Nov 2018 12:23:12 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9lua=20bind?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua/modules/audio/je_lua_audio.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/lua/modules/audio/je_lua_audio.cpp') 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(src, Jin_Lua_Source)); + Proxy* proxy = luax_newinstance(L, Jin_Lua_Source, new Shared(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; } -- cgit v1.1-26-g67d0