From 94f140454f8bb1629c0308d3c41ea54f40aa5c63 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 11 Mar 2013 22:46:25 -0300 Subject: [PATCH] More Quad code cleanup --- src/modules/graphics/opengl/wrap_Graphics.cpp | 9 +++------ src/modules/graphics/opengl/wrap_Graphics.h | 2 +- src/modules/graphics/opengl/wrap_Quad.cpp | 2 +- src/modules/graphics/opengl/wrap_Quad.h | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index 7d30eb79e..be49e5cc2 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -309,12 +309,9 @@ int w_newQuad(lua_State *L) float sw = (float) luaL_checknumber(L, 5); float sh = (float) luaL_checknumber(L, 6); - Quad *frame = instance->newQuad(x, y, w, h, sw, sh); + Quad *quad = instance->newQuad(x, y, w, h, sw, sh); - if (frame == 0) - return luaL_error(L, "Could not create frame."); - - luax_newtype(L, "Quad", GRAPHICS_QUAD_T, (void *)frame); + luax_newtype(L, "Quad", GRAPHICS_QUAD_T, (void *)quad); return 1; } @@ -1385,7 +1382,7 @@ static const lua_CFunction types[] = { luaopen_font, luaopen_image, - luaopen_frame, + luaopen_quad, luaopen_spritebatch, luaopen_particlesystem, luaopen_canvas, diff --git a/src/modules/graphics/opengl/wrap_Graphics.h b/src/modules/graphics/opengl/wrap_Graphics.h index aa2e1abde..afd7c42f0 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.h +++ b/src/modules/graphics/opengl/wrap_Graphics.h @@ -58,7 +58,7 @@ int w_defineMask(lua_State *L); int w_setMask(lua_State *L); int w_newImage(lua_State *L); int w_newQuad(lua_State *L); -int w_newFrame(lua_State *L); +int w_newQuad(lua_State *L); int w_newFont(lua_State *L); int w_newImageFont(lua_State *L); int w_newSpriteBatch(lua_State *L); diff --git a/src/modules/graphics/opengl/wrap_Quad.cpp b/src/modules/graphics/opengl/wrap_Quad.cpp index 9e16902be..7055e0943 100644 --- a/src/modules/graphics/opengl/wrap_Quad.cpp +++ b/src/modules/graphics/opengl/wrap_Quad.cpp @@ -71,7 +71,7 @@ static const luaL_Reg w_Quad_functions[] = { 0, 0 } }; -extern "C" int luaopen_frame(lua_State *L) +extern "C" int luaopen_quad(lua_State *L) { return luax_register_type(L, "Quad", w_Quad_functions); } diff --git a/src/modules/graphics/opengl/wrap_Quad.h b/src/modules/graphics/opengl/wrap_Quad.h index fe02c9671..fe620943e 100644 --- a/src/modules/graphics/opengl/wrap_Quad.h +++ b/src/modules/graphics/opengl/wrap_Quad.h @@ -36,7 +36,7 @@ Quad *luax_checkquad(lua_State *L, int idx); int w_Quad_flip(lua_State *L); int w_Quad_setViewport(lua_State *L); int w_Quad_getViewport(lua_State *L); -extern "C" int luaopen_frame(lua_State *L); +extern "C" int luaopen_quad(lua_State *L); } // opengl } // graphics