Commits

vrld committed 459a47c

Make setDefaultImageFilter() not break image:setFilter() (thanks adrix89!)

Comments (0)

Files changed (3)

src/modules/graphics/opengl/Graphics.cpp

 	Image * Graphics::newImage(love::image::ImageData * data)
 	{
 		// Create the image.
-		Image * image = new Image(data, currentImageFilter);
+		Image * image = new Image(data);
 		bool success;
 		try {
 			success = image->load();
 			return 0;
 		}
 
+		image->setFilter(currentImageFilter);
+
 		return image;
 	}
 

src/modules/graphics/opengl/Image.cpp

 // STD
 #include <cstring> // For memcpy
 
+#include <iostream>
+using namespace std;
+
 namespace love
 {
 namespace graphics
 {
 namespace opengl
 {
-	Image::Image(love::image::ImageData * data, const Image::Filter& filter)
+	Image::Image(love::image::ImageData * data)
 		: width((float)(data->getWidth())), height((float)(data->getHeight())), texture(0)
 	{
 		data->retain();
 		vertices[1].s = 0; vertices[1].t = 1;
 		vertices[2].s = 1; vertices[2].t = 1;
 		vertices[3].s = 1; vertices[3].t = 0;
-
-		setFilter(filter);
 	}
 
 	Image::~Image()

src/modules/graphics/opengl/Image.h

 		*
 		* @param file The file from which to load the image.
 		**/
-		Image(love::image::ImageData * data, const Image::Filter& f = Image::Filter());
+		Image(love::image::ImageData * data);
 
 		/**
 		* Destructor. Deletes the hardware texture and other resources.