[Scummvm-cvs-logs] CVS: scummvm/backends/sdl sdl.cpp,1.8,1.9

Max Horn fingolfin at users.sourceforge.net
Sun Sep 29 11:20:04 CEST 2002


Update of /cvsroot/scummvm/scummvm/backends/sdl
In directory usw-pr-cvs1:/tmp/cvs-serv10923/sdl

Modified Files:
	sdl.cpp 
Log Message:
fixed buglet during shake mode

Index: sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- sdl.cpp	28 Sep 2002 16:19:27 -0000	1.8
+++ sdl.cpp	29 Sep 2002 18:19:57 -0000	1.9
@@ -301,10 +301,19 @@
 
 void OSystem_SDL_Normal::update_screen() {
 	
-	if (sdl_hwscreen == NULL)
-		return;	// Can this really happen?
+	assert(sdl_hwscreen != NULL);
 
-	// First make sure the mouse is drawn, if it should be drawn.
+	// If the shake position changed, fill the dirty area with blackness
+	if (_currentShakePos != _newShakePos) {
+		SDL_Rect blackrect = {0, 0, _screenWidth*_scaleFactor, _newShakePos*_scaleFactor};
+		SDL_FillRect(sdl_hwscreen, &blackrect, 0);
+
+		_currentShakePos = _newShakePos;
+
+		_forceFull = true;
+	}
+
+	// Make sure the mouse is drawn, if it should be drawn.
 	draw_mouse();
 	
 	// Check whether the palette was changed in the meantime and update the
@@ -319,17 +328,6 @@
 		_forceFull = true;
 	}
 
-	
-	/* If the shake position changed, fill the dirty area with blackness */
-	if (_currentShakePos != _newShakePos) {
-		SDL_Rect blackrect = {0, 0, _screenWidth*_scaleFactor, _newShakePos*_scaleFactor};
-		SDL_FillRect(sdl_hwscreen, &blackrect, 0);
-
-		_currentShakePos = _newShakePos;
-
-		_forceFull = true;
-	}
-
 	// Force a full redraw if requested
 	if (_forceFull) {
 		_num_dirty_rects = 1;
@@ -387,6 +385,13 @@
 		
 		SDL_UnlockSurface(sdl_tmpscreen);
 		SDL_UnlockSurface(sdl_hwscreen);
+
+		// Readjust the dirty rect list in case we are doing a full update.
+		// This is necessary if shaking is active.
+		if (_forceFull) {
+			_dirty_rect_list[0].y = 0;
+			_dirty_rect_list[0].h = _screenHeight * _scaleFactor;
+		}
 
 		// Finally, blit all our changes to the screen
 		SDL_UpdateRects(sdl_hwscreen, _num_dirty_rects, _dirty_rect_list);





More information about the Scummvm-git-logs mailing list