[Scummvm-cvs-logs] CVS: scummvm/common scaler.cpp,1.4,1.5

Max Horn fingolfin at users.sourceforge.net
Sat Jan 18 13:05:04 CET 2003


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv10897

Modified Files:
	scaler.cpp 
Log Message:
optimized Normal1x a bit (well at least memcpy won't be slower and on many systems will be faster)

Index: scaler.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- scaler.cpp	15 Jan 2003 02:11:37 -0000	1.4
+++ scaler.cpp	18 Jan 2003 21:04:31 -0000	1.5
@@ -750,15 +750,8 @@
 void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
 							int width, int height)
 {
-	uint16 *r;
-
 	while (height--) {
-		r = (uint16 *)dstPtr;
-		for (int i = 0; i < width; ++i, ++r) {
-			uint16 color = *(((uint16 *)srcPtr) + i);
-
-			*r = color;
-		}
+		memcpy(dstPtr, srcPtr, 2 * width);
 		srcPtr += srcPitch;
 		dstPtr += dstPitch;
 	}





More information about the Scummvm-git-logs mailing list