From b52aa211c801a0cc15ed09553e3ff1835662b60b Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 24 Aug 2018 20:47:59 +0800 Subject: *update --- src/lua/modules/graphics/image.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/lua/modules/graphics/image.cpp') diff --git a/src/lua/modules/graphics/image.cpp b/src/lua/modules/graphics/image.cpp index 5824660..3caff16 100644 --- a/src/lua/modules/graphics/image.cpp +++ b/src/lua/modules/graphics/image.cpp @@ -11,8 +11,9 @@ namespace lua using namespace jin::graphics; typedef Texture Image; + typedef Ref& ImageRef; - static inline Ref& checkImage(lua_State* L) + static inline ImageRef checkImage(lua_State* L) { Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_GRAPHICS_IMAGE); return proxy->getRef(); @@ -20,21 +21,21 @@ namespace lua static int l_getWidth(lua_State* L) { - Ref& ref = checkImage(L); + ImageRef ref = checkImage(L); luax_pushnumber(L, ref->getWidth()); return 1; } static int l_getHeight(lua_State *L) { - Ref& ref = checkImage(L); + ImageRef ref = checkImage(L); luax_pushnumber(L, ref->getHeight()); return 1; } static int l_getPixel(lua_State* L) { - Ref& ref = checkImage(L); + ImageRef ref = checkImage(L); int x = luax_checknumber(L, 2); int y = luax_checknumber(L, 3); color c = ref->getPixel(x, y); @@ -47,7 +48,7 @@ namespace lua static int l_setAnchor(lua_State* L) { - Ref& ref = checkImage(L); + ImageRef ref = checkImage(L); int x = luax_checknumber(L, 2); int y = luax_checknumber(L, 3); ref->setAnchor(x, y); @@ -56,7 +57,7 @@ namespace lua static int l_getSize(lua_State* L) { - Ref& ref = checkImage(L); + ImageRef ref = checkImage(L); luax_pushnumber(L, ref->getWidth()); luax_pushnumber(L, ref->getHeight()); return 2; -- cgit v1.1-26-g67d0