Improved performance and reduced temporary memory usage of love.graphics.newScreenshot and Canvas:getImageData

This commit is contained in:
Alex Szpakowski
2013-06-15 22:07:16 -03:00
parent 15535517d6
commit f25efcc8af
7 changed files with 18 additions and 12 deletions
+2 -2
View File
@@ -652,10 +652,10 @@ love::image::ImageData *Canvas::getImageData(love::image::Image *image)
for (int i = 0; i < height; ++i, dst -= row, src += row)
memcpy(dst, src, row);
love::image::ImageData *img = image->newImageData(width, height, (void *)flipped);
love::image::ImageData *img = image->newImageData(width, height, (void *)flipped, true);
// The new ImageData now owns the flipped data, so we don't delete it here.
delete[] pixels;
delete[] flipped;
return img;
}