[Scummvm-cvs-logs] SF.net SVN: scummvm:[50424] scummvm/trunk/engines/sci/graphics/screen.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Jun 28 13:21:07 CEST 2010


Revision: 50424
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50424&view=rev
Author:   fingolfin
Date:     2010-06-28 11:21:07 +0000 (Mon, 28 Jun 2010)

Log Message:
-----------
SCI: Optimized GfxScreen::scale2x a bit

Modified Paths:
--------------
    scummvm/trunk/engines/sci/graphics/screen.cpp

Modified: scummvm/trunk/engines/sci/graphics/screen.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/screen.cpp	2010-06-28 11:20:51 UTC (rev 50423)
+++ scummvm/trunk/engines/sci/graphics/screen.cpp	2010-06-28 11:21:07 UTC (rev 50424)
@@ -594,18 +594,19 @@
 }
 
 void GfxScreen::scale2x(const byte *src, byte *dst, int16 srcWidth, int16 srcHeight) {
-	int newWidth = srcWidth * 2;
+	const int newWidth = srcWidth * 2;
 	const byte *srcPtr = src;
 
 	for (int y = 0; y < srcHeight; y++) {
 		for (int x = 0; x < srcWidth; x++) {
-			int destOffset = y * 2 * newWidth + x * 2;
-			dst[destOffset] = *srcPtr;
-			dst[destOffset + 1] = *srcPtr;
-			dst[destOffset + newWidth] = *srcPtr;
-			dst[destOffset + newWidth + 1] = *srcPtr;
-			srcPtr++;
+			const byte color = *srcPtr++;
+			dst[0] = color;
+			dst[1] = color;
+			dst[newWidth] = color;
+			dst[newWidth + 1] = color;
+			dst += 2;
 		}
+		dst += srcWidth;
 	}
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list