[Scummvm-cvs-logs] CVS: scummvm/common scaler.cpp,1.61,1.62

Max Horn fingolfin at users.sourceforge.net
Sun Aug 8 08:47:02 CEST 2004


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4794

Modified Files:
	scaler.cpp 
Log Message:
Slightly optimiized Normal2x

Index: scaler.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- scaler.cpp	7 Aug 2004 17:21:52 -0000	1.61
+++ scaler.cpp	8 Aug 2004 15:45:58 -0000	1.62
@@ -123,15 +123,16 @@
 							int width, int height) {
 	uint8 *r;
 
+	assert(((int)dstPtr & 3) == 0);
 	while (height--) {
 		r = dstPtr;
 		for (int i = 0; i < width; ++i, r += 4) {
-			uint16 color = *(((const uint16 *)srcPtr) + i);
+			uint32 color = *(((const uint16 *)srcPtr) + i);
+			
+			color |= color << 16;
 
-			*(uint16 *)(r + 0) = color;
-			*(uint16 *)(r + 2) = color;
-			*(uint16 *)(r + 0 + dstPitch) = color;
-			*(uint16 *)(r + 2 + dstPitch) = color;
+			*(uint32 *)(r) = color;
+			*(uint32 *)(r + dstPitch) = color;
 		}
 		srcPtr += srcPitch;
 		dstPtr += dstPitch << 1;
@@ -147,6 +148,7 @@
 	const uint32 dstPitch2 = dstPitch * 2;
 	const uint32 dstPitch3 = dstPitch * 3;
 
+	assert(((int)dstPtr & 3) == 0);
 	while (height--) {
 		r = dstPtr;
 		for (int i = 0; i < width; ++i, r += 6) {





More information about the Scummvm-git-logs mailing list