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

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Mon Feb 1 01:53:13 CET 2010


Revision: 47788
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47788&view=rev
Author:   mthreepwood
Date:     2010-02-01 00:53:13 +0000 (Mon, 01 Feb 2010)

Log Message:
-----------
Skip extra pixels at the end of each row in the cel so that they don't carry over to the next row if the dest width is less than the source width. Fixes several images in Mixed-Up Mother Goose (SCI1).

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

Modified: scummvm/trunk/engines/sci/graphics/picture.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/picture.cpp	2010-02-01 00:23:05 UTC (rev 47787)
+++ scummvm/trunk/engines/sci/graphics/picture.cpp	2010-02-01 00:53:13 UTC (rev 47788)
@@ -295,9 +295,14 @@
 			curByte = *ptr++;
 			if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y)))
 				_screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL | SCI_SCREEN_MASK_PRIORITY, curByte, priority, 0);
+
 			x++;
+
 			if (x >= rightX) {
-				x = leftX; y++;
+				if (width > rightX - leftX) // Skip extra pixels at the end of the row
+					ptr += width - (rightX - leftX);
+				x = leftX;
+				y++;
 			}
 		}
 	} else {
@@ -307,12 +312,18 @@
 			curByte = *ptr++;
 			if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y)))
 				_screen->putPixel(x, y, SCI_SCREEN_MASK_VISUAL | SCI_SCREEN_MASK_PRIORITY, curByte, priority, 0);
+			
 			if (x == leftX) {
-				x = rightX; y++;
+				if (width > rightX - leftX) // Skip extra pixels at the end of the row
+					ptr += width - (rightX - leftX);
+				x = rightX;
+				y++;
 			}
+
 			x--;
 		}
 	}
+
 	delete[] celBitmap;
 }
 


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