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/graphics/je_lua_ttf_data.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/lua/modules/graphics/je_lua_ttf_data.cpp') diff --git a/src/lua/modules/graphics/je_lua_ttf_data.cpp b/src/lua/modules/graphics/je_lua_ttf_data.cpp index dedf082..aa2280f 100644 --- a/src/lua/modules/graphics/je_lua_ttf_data.cpp +++ b/src/lua/modules/graphics/je_lua_ttf_data.cpp @@ -22,11 +22,10 @@ namespace JinEngine int fontsize = luax_checkinteger(L, 2); Shared& shrFontData = pxyTTFData->getShared(); TTFData* fontData = shrFontData.getObject(); - Proxy* pxyTTF = luax_newinstance(L, Jin_Lua_TTF); TTF* font = fontData->createTTF(fontsize); Shared* shrTTF = new Shared(font, Jin_Lua_TTF); shrTTF->setDependency((int)TTFDependency::DEP_TTFDATA, &shrFontData); - pxyTTF->bind(shrTTF); + Proxy* pxyTTF = luax_newinstance(L, Jin_Lua_TTF, shrTTF); return 1; } @@ -39,12 +38,12 @@ namespace JinEngine LUA_EXPORT void luaopen_TTFData(lua_State* L) { - luaL_Reg f[] = { + luaL_Reg methods[] = { { "__gc", l_gc }, { "newTTF", l_newTTF }, { 0, 0 } }; - luax_newtype(L, Jin_Lua_TTFData, f); + luax_newtype(L, Jin_Lua_TTFData, methods); } -- cgit v1.1-26-g67d0