[Scummvm-cvs-logs] CVS: scummvm/backends/sdl sdl-common.cpp,1.54,1.55

Bertrand Augereau tramboi at users.sourceforge.net
Thu Jun 5 00:53:04 CEST 2003


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

Modified Files:
	sdl-common.cpp 
Log Message:
optimisation to blit rects in one shot when width=pitch=screenwidth

Index: sdl-common.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/sdl/sdl-common.cpp,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- sdl-common.cpp	29 May 2003 22:34:34 -0000	1.54
+++ sdl-common.cpp	5 Jun 2003 07:52:50 -0000	1.55
@@ -197,11 +197,17 @@
 		error("SDL_LockSurface failed: %s.\n", SDL_GetError());
 
 	byte *dst = (byte *)_screen->pixels + y * _screenWidth + x;
-	do {
-		memcpy(dst, buf, w);
-		dst += _screenWidth;
-		buf += pitch;
-	} while (--h);
+
+	if (_screenWidth==pitch && pitch==w)
+		memcpy (dst, buf, h*w);
+	else
+	{
+		do {
+			memcpy(dst, buf, w);
+			dst += _screenWidth;
+			buf += pitch;
+		} while (--h);
+	}
 
 	SDL_UnlockSurface(_screen);
 }





More information about the Scummvm-git-logs mailing list