changeset 668:e8a799239384

* This fixes the case were the engine would clear the screen twice The editor and demos now suffer from a problem where if a map is not loaded the screen doesnt get cleared and you see traces of the UI from previous frames. For now the editor, RPG demo and Shooter force the engine to clear the screen every frame. This is not ideal as once a map is loaded they will be clearing the screen twice per frame.
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Mon, 08 Nov 2010 20:37:31 +0000
parents a5809f60d548
children 46258f467c8c
files engine/core/video/renderbackend.cpp engine/core/video/sdl/renderbackendsdl.cpp engine/core/view/camera.cpp tools/editor/scripts/editor.py
diffstat 4 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/engine/core/video/renderbackend.cpp	Mon Nov 08 18:21:05 2010 +0000
+++ b/engine/core/video/renderbackend.cpp	Mon Nov 08 20:37:31 2010 +0000
@@ -58,7 +58,7 @@
 	void RenderBackend::pushClipArea(const Rect& cliparea, bool clear) {
 		assert(m_screen);
 		m_screen->pushClipArea(cliparea, clear);
-        }
+	}
 
 	void RenderBackend::popClipArea() {
 		assert(m_screen);
--- a/engine/core/video/sdl/renderbackendsdl.cpp	Mon Nov 08 18:21:05 2010 +0000
+++ b/engine/core/video/sdl/renderbackendsdl.cpp	Mon Nov 08 20:37:31 2010 +0000
@@ -42,7 +42,7 @@
 	static Logger _log(LM_VIDEO);
 
 	RenderBackendSDL::RenderBackendSDL(const SDL_Color& colorkey) : RenderBackend(colorkey) {
-		m_clear = true;
+		m_clear = false;
 	}
 
 
@@ -199,7 +199,7 @@
 
 	void RenderBackendSDL::changeBlending(int scr, int dst){
 	}
-	
+
 	bool RenderBackendSDL::putPixel(int x, int y, int r, int g, int b, int a) {
 		return static_cast<SDLImage*>(m_screen)->putPixel(x, y, r, g, b, a);
 	}
--- a/engine/core/view/camera.cpp	Mon Nov 08 18:21:05 2010 +0000
+++ b/engine/core/view/camera.cpp	Mon Nov 08 20:37:31 2010 +0000
@@ -452,7 +452,6 @@
 		if(trec1 && trec2 && trec3 && trec4) {
 			return false;
 		}
-		m_renderbackend->clearBackBuffer();
 		return true;
 	}
 
--- a/tools/editor/scripts/editor.py	Mon Nov 08 18:21:05 2010 +0000
+++ b/tools/editor/scripts/editor.py	Mon Nov 08 20:37:31 2010 +0000
@@ -104,6 +104,8 @@
 		ApplicationBase.__init__(self, TDS, *args, **kwargs)
 		MainWindow.__init__(self, *args, **kwargs)
 		
+		self.engine.getRenderBackend().setClearBackBuffer(True)
+		
 	def _initTools(self):
 		""" Initializes tools """
 		self._pluginmanager = plugin.PluginManager(self.getSettings())