[Scummvm-cvs-logs] CVS: scummvm/backends/sdl sdl.cpp,1.31,1.32

Max Horn fingolfin at users.sourceforge.net
Wed May 28 14:58:06 CEST 2003


Update of /cvsroot/scummvm/scummvm/backends/sdl
In directory sc8-pr-cvs1:/tmp/cvs-serv7798

Modified Files:
	sdl.cpp 
Log Message:
there used to be a black border at the top/left side with the 1x scaler: fixed!

Index: sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- sdl.cpp	14 May 2003 19:47:57 -0000	1.31
+++ sdl.cpp	28 May 2003 21:57:22 -0000	1.32
@@ -275,33 +275,34 @@
 	if (_num_dirty_rects > 0) {
 
 		SDL_Rect *r; 
+		SDL_Rect dst;
 		uint32 srcPitch, dstPitch;
 		SDL_Rect *last_rect = _dirty_rect_list + _num_dirty_rects;
 
-		// Convert appropriate parts of the 8bpp image into 16bpp
-		SDL_Rect dst;
-		if (!_overlayVisible) {
+		if (_scaler_proc == Normal1x) {
+			SDL_Surface *target = _overlayVisible ? _tmpscreen : _screen;
 			for(r = _dirty_rect_list; r != last_rect; ++r) {
 				dst = *r;
-				dst.x++;	// Shift rect by one since 2xSai needs to acces the data around
-				dst.y++;	// any pixel to scale it, and we want to avoid mem access crashes.
-				if (_scaler_proc == Normal1x) {
-					if (SDL_BlitSurface(_screen, r, _hwscreen, &dst) != 0)
-						error("SDL_BlitSurface failed: %s", SDL_GetError());
-				} else {
+				
+				if (_overlayVisible) {
+					// FIXME: I don't understand why this is necessary...
+					dst.x--;
+					dst.y--;
+				}
+				if (SDL_BlitSurface(target, r, _hwscreen, &dst) != 0)
+					error("SDL_BlitSurface failed: %s", SDL_GetError());
+			}
+		} else {
+			if (!_overlayVisible) {
+				for(r = _dirty_rect_list; r != last_rect; ++r) {
+					dst = *r;
+					dst.x++;	// Shift rect by one since 2xSai needs to acces the data around
+					dst.y++;	// any pixel to scale it, and we want to avoid mem access crashes.
 					if (SDL_BlitSurface(_screen, r, _tmpscreen, &dst) != 0)
 						error("SDL_BlitSurface failed: %s", SDL_GetError());
 				}
 			}
-		} else if (_scaler_proc == Normal1x) {
-			for(r = _dirty_rect_list; r != last_rect; ++r) {
-				dst = *r;
-				if (SDL_BlitSurface(_tmpscreen, r, _hwscreen, &dst) != 0)
-					error("SDL_BlitSurface failed: %s", SDL_GetError());
-			}
-		}
 
-		if (_scaler_proc != Normal1x) {
 			SDL_LockSurface(_tmpscreen);
 			SDL_LockSurface(_hwscreen);
 





More information about the Scummvm-git-logs mailing list