changeset 417:14e8087cde2c

Fixed the problem where the opengl renderer was leaving traces on the screen after closing maps in the editor. [t:392] Removed a member variable in SDLImage that was not being used.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Wed, 03 Feb 2010 20:04:39 +0000
parents a8bb57884723
children 70ba57cd9d18
files engine/core/video/opengl/renderbackendopengl.cpp engine/core/video/sdl/sdlimage.h
diffstat 2 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/engine/core/video/opengl/renderbackendopengl.cpp	Wed Feb 03 18:59:34 2010 +0000
+++ b/engine/core/video/opengl/renderbackendopengl.cpp	Wed Feb 03 20:04:39 2010 +0000
@@ -132,7 +132,9 @@
 	}
 
 	void RenderBackendOpenGL::startFrame() {
+		glDisable(GL_SCISSOR_TEST);
 		glClear(GL_COLOR_BUFFER_BIT);
+		glEnable(GL_SCISSOR_TEST);
 	}
 
 	void RenderBackendOpenGL::endFrame() {
@@ -173,7 +175,7 @@
 	Image* RenderBackendOpenGL::createImage(const uint8_t* data, unsigned int width, unsigned int height) {
 		return new GLImage(data, width, height);
 	}
-	
+
 	bool RenderBackendOpenGL::putPixel(int x, int y, int r, int g, int b) {
 		if ((x < 0) || (x >= (int)getWidth()) || (y < 0) || (y >= (int)getHeight())) {
 			return false;
@@ -184,7 +186,7 @@
 		glEnd();
 		return true;
 	}
-	
+
 	void RenderBackendOpenGL::drawLine(const Point& p1, const Point& p2, int r, int g, int b) {
 		glColor4ub(r, g, b, 255);
 		glBegin(GL_LINES);
@@ -196,7 +198,7 @@
 		glVertex3f(p2.x+0.5f, p2.y+0.5f, 0);
 		glEnd();
 	}
-	
+
 	void RenderBackendOpenGL::drawQuad(const Point& p1, const Point& p2, const Point& p3, const Point& p4,  int r, int g, int b) {
 	        glColor4ub(r, g, b, 165);
 		glBegin(GL_QUADS);
@@ -206,5 +208,5 @@
 		glVertex3f(p4.x, p4.y, 0);
 		glEnd();
 	}
-	
+
 }
--- a/engine/core/video/sdl/sdlimage.h	Wed Feb 03 18:59:34 2010 +0000
+++ b/engine/core/video/sdl/sdlimage.h	Wed Feb 03 20:04:39 2010 +0000
@@ -50,26 +50,24 @@
 
 	protected:
 		void setClipArea(const Rect& cliparea, bool clear);
-	
+
 	private:
 		// Call this before rendering
 		void finalize();
-		
+
 		/** SDL Alpha Optimizer
 		 * This tries to convert an image with a fake alpha channel
 		 * to an RGB image when the channel can be reasonably be replaced
 		 * by an colorkey.
 		 */
 		SDL_Surface* optimize(SDL_Surface* surface);
-		
+
 		void resetSdlimage();
-		
+
 		// SDLSurface used to create the SDLImage.
 		Uint8 m_last_alpha;
 		// Is the surface already optimized for rendering
 		bool m_finalized;
-		// Wether to try to optimize alpha out ...
-		bool m_optimize_alpha;
 	};
 
 }