diff --git a/src/modules/graphics/opengl/Image.cpp b/src/modules/graphics/opengl/Image.cpp index d79465a4e..82f1f4857 100644 --- a/src/modules/graphics/opengl/Image.cpp +++ b/src/modules/graphics/opengl/Image.cpp @@ -121,7 +121,7 @@ namespace opengl drawv(t, cache); } - void Image::draws(float x, float y, float angle, float sx, float sy, float ox, float oy, Frame * frame) const + void Image::drawf(float x, float y, float angle, float sx, float sy, float ox, float oy, Frame * frame) const { static Matrix t; const vertex * v = frame->getVertices(); diff --git a/src/modules/graphics/opengl/Image.h b/src/modules/graphics/opengl/Image.h index 22852aca2..e28f6f2c5 100644 --- a/src/modules/graphics/opengl/Image.h +++ b/src/modules/graphics/opengl/Image.h @@ -121,7 +121,7 @@ namespace opengl * @copydetails Image::draws() * @param frame Represents the region of the Image to draw. **/ - void draws(float x, float y, float angle, float sx, float sy, float ox, float oy, Frame * frame) const; + void drawf(float x, float y, float angle, float sx, float sy, float ox, float oy, Frame * frame) const; /** * Sets the filter mode. diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index 53bf7887b..48379b957 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -483,6 +483,34 @@ namespace opengl return 0; } + /** + * Draws an Frame of an Image at the specified coordinates, + * with rotation and scaling along both axes. + * + * @param x The x-coordinate. + * @param y The y-coordinate. + * @param angle The amount of rotation. + * @param sx The scale factor along the x-axis. (1 = normal). + * @param sy The scale factor along the y-axis. (1 = normal). + * @param ox The offset along the x-axis. + * @param oy The offset along the y-axis. + * @param f The Frame to dra. + **/ + int _wrap_drawf(lua_State * L) + { + Image * image = luax_checktype(L, 1, "Image", LOVE_GRAPHICS_IMAGE_BITS); + float x = (float)luaL_checknumber(L, 2); + float y = (float)luaL_checknumber(L, 3); + float angle = (float)luaL_checknumber(L, 4); + float sx = (float)luaL_checknumber(L, 5); + float sy = (float)luaL_checknumber(L, 6); + float ox = (float)luaL_checknumber(L, 7); + float oy = (float)luaL_checknumber(L, 8); + Frame * f = luax_checkframe(L, 9); + image->drawf(x, y, angle, sx, sy, ox, oy, f); + return 0; + } + int _wrap_drawTest(lua_State * L) { Image * image = luax_checktype(L, 1, "Image", LOVE_GRAPHICS_IMAGE_BITS); @@ -687,6 +715,7 @@ namespace opengl { "draw", _wrap_draw }, { "draws", _wrap_draws }, + { "drawf", _wrap_drawf }, { "drawTest", _wrap_drawTest }, { "print", _wrap_print },