diff --git a/src/modules/graphics/opengl/Canvas.cpp b/src/modules/graphics/opengl/Canvas.cpp index 8f5a44eea..d90c5ce78 100644 --- a/src/modules/graphics/opengl/Canvas.cpp +++ b/src/modules/graphics/opengl/Canvas.cpp @@ -955,7 +955,7 @@ bool Canvas::checkCreateStencil() return success; } -love::image::ImageData *Canvas::getImageData(love::image::Image *image, int x, int y, int w, int h) +love::image::ImageData *Canvas::newImageData(love::image::Image *image, int x, int y, int w, int h) { if (x < 0 || y < 0 || w <= 0 || h <= 0 || (x + w) > width || (y + h) > height) throw love::Exception("Invalid ImageData rectangle dimensions."); diff --git a/src/modules/graphics/opengl/Canvas.h b/src/modules/graphics/opengl/Canvas.h index 3c4c93a45..44fabd0e6 100644 --- a/src/modules/graphics/opengl/Canvas.h +++ b/src/modules/graphics/opengl/Canvas.h @@ -91,7 +91,7 @@ public: **/ bool checkCreateStencil(); - love::image::ImageData *getImageData(love::image::Image *image, int x, int y, int w, int h); + love::image::ImageData *newImageData(love::image::Image *image, int x, int y, int w, int h); inline const std::vector &getAttachedCanvases() const { diff --git a/src/modules/graphics/opengl/wrap_Canvas.cpp b/src/modules/graphics/opengl/wrap_Canvas.cpp index ec37b60d3..458e24be3 100644 --- a/src/modules/graphics/opengl/wrap_Canvas.cpp +++ b/src/modules/graphics/opengl/wrap_Canvas.cpp @@ -62,7 +62,7 @@ int w_Canvas_renderTo(lua_State *L) return 0; } -int w_Canvas_getImageData(lua_State *L) +int w_Canvas_newImageData(lua_State *L) { Canvas *canvas = luax_checkcanvas(L, 1); love::image::Image *image = luax_getmodule(L, "image", MODULE_IMAGE_T); @@ -71,7 +71,7 @@ int w_Canvas_getImageData(lua_State *L) int w = luaL_optint(L, 4, canvas->getWidth()); int h = luaL_optint(L, 5, canvas->getHeight()); - love::image::ImageData *img = canvas->getImageData(image, x, y, w, h); + love::image::ImageData *img = canvas->newImageData(image, x, y, w, h); luax_pushtype(L, "ImageData", IMAGE_IMAGE_DATA_T, img); img->release(); return 1; @@ -140,7 +140,7 @@ static const luaL_Reg functions[] = { "getWrap", w_Texture_getWrap }, { "renderTo", w_Canvas_renderTo }, - { "getImageData", w_Canvas_getImageData }, + { "newImageData", w_Canvas_newImageData }, { "clear", w_Canvas_clear }, { "getFormat", w_Canvas_getFormat }, { "getMSAA", w_Canvas_getMSAA }, diff --git a/src/modules/graphics/opengl/wrap_Canvas.h b/src/modules/graphics/opengl/wrap_Canvas.h index 1093f980f..edfecdda8 100644 --- a/src/modules/graphics/opengl/wrap_Canvas.h +++ b/src/modules/graphics/opengl/wrap_Canvas.h @@ -36,8 +36,7 @@ namespace opengl //see Canvas.h Canvas *luax_checkcanvas(lua_State *L, int idx); int w_Canvas_renderTo(lua_State *L); -int w_Canvas_getImageData(lua_State *L); -int w_Canvas_getPixel(lua_State * L); +int w_Canvas_newImageData(lua_State *L); int w_Canvas_clear(lua_State *L); int w_Canvas_getFormat(lua_State *L); int w_Canvas_getMSAA(lua_State *L);