aboutsummaryrefslogtreecommitdiff
path: root/src/lua/graphics/luaopen_Font.cpp
diff options
context:
space:
mode:
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