From 5c9af043503f92852a1a765b6ecfbc1aea24d2e9 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 14 Aug 2018 14:56:47 +0800 Subject: *update --- src/lua/graphics/luaopen_Font.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/lua/graphics/luaopen_Font.cpp') diff --git a/src/lua/graphics/luaopen_Font.cpp b/src/lua/graphics/luaopen_Font.cpp index 3de2981..3643412 100644 --- a/src/lua/graphics/luaopen_Font.cpp +++ b/src/lua/graphics/luaopen_Font.cpp @@ -11,12 +11,15 @@ namespace lua static int l_gc(lua_State* L) { + Proxy* proxy = (Proxy*)luax_newinstance(L, JIN_GRAPHICS_FONT, sizeof(Proxy)); + proxy->release(); return 0; } static int l_box(lua_State* L) { - Font* font = (Font*)luax_checktype(L, 1, JIN_GRAPHICS_FONT); + Proxy* proxy = (Proxy*)luax_newinstance(L, JIN_GRAPHICS_FONT, sizeof(Proxy)); + Font* font = (Font*)proxy->object; const char* text = luax_checkstring(L, 2); int fheight = luax_checknumber(L, 3); int spacing = luax_checknumber(L, 4); @@ -41,5 +44,5 @@ namespace lua return 0; } -} -} \ No newline at end of file +} // lua +} // jin \ No newline at end of file -- cgit v1.1-26-g67d0