Browse Source

Renamed Canvas:getImageData to Canvas:newImageData (see issue #1001.)

--HG--
branch : minor
Alex Szpakowski 10 years ago
parent
commit
e8ce59038f

+ 1 - 1
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.");

+ 1 - 1
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<Canvas *> &getAttachedCanvases() const
 	{

+ 3 - 3
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<love::image::Image>(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 },

+ 1 - 2
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);