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

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Tue Feb 1 04:50:29 CET 2011


Revision: 55705
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55705&view=rev
Author:   mthreepwood
Date:     2011-02-01 03:50:29 +0000 (Tue, 01 Feb 2011)

Log Message:
-----------
SCI: Fix SCI1.1+ Mac views with uint16 rle lengths (thanks, Walter)

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

Modified: scummvm/trunk/engines/sci/graphics/view.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/view.cpp	2011-02-01 03:05:18 UTC (rev 55704)
+++ scummvm/trunk/engines/sci/graphics/view.cpp	2011-02-01 03:50:29 UTC (rev 55705)
@@ -449,12 +449,24 @@
 			literalPtr = _resourceData + celInfo->offsetLiteral;
 			if (celInfo->offsetRLE) {
 				if (g_sci->getPlatform() == Common::kPlatformMacintosh && getSciVersion() >= SCI_VERSION_1_1) {
+					// KQ6 uses byte lengths, all others use uint16
+					// The SCI devs must have quickly realized that a max of 255 pixels wide
+					// was not very good for 320 or 640 width games.
+					bool hasByteLengths = (g_sci->getGameId() == GID_KQ6);
+
 					// compression for SCI1.1+ Mac
 					while (pixelNo < pixelCount) {
 						uint32 pixelLine = pixelNo;
-						runLength = *rlePtr++;
-						pixelNo += runLength;
-						runLength = *rlePtr++;
+		
+						if (hasByteLengths) {
+							pixelNo += *rlePtr++;
+							runLength = *rlePtr++;
+						} else {
+							pixelNo += READ_BE_UINT16(rlePtr);
+							runLength = READ_BE_UINT16(rlePtr + 2);
+							rlePtr += 4;
+						}
+
 						while (runLength-- && pixelNo < pixelCount) {
 							outPtr[pixelNo] = *literalPtr++;
 							if (outPtr[pixelNo] == 255)


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