vrld avatar 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.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.