aboutsummaryrefslogtreecommitdiff
path: root/src/lua/graphics/luaopen_Font.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-08-14 14:56:47 +0800
committerchai <chaifix@163.com>2018-08-14 14:56:47 +0800
commit5c9af043503f92852a1a765b6ecfbc1aea24d2e9 (patch)
treeeb371092c4137a672e7bfc13dc56ee777623ebfe /src/lua/graphics/luaopen_Font.cpp
parent5162f84be0a4deb447c6ba1226722b049335d525 (diff)
*update
Diffstat (limited to 'src/lua/graphics/luaopen_Font.cpp')
-rw-r--r--src/lua/graphics/luaopen_Font.cpp9
1 files changed, 6 insertions, 3 deletions
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