[Scummvm-cvs-logs] scummvm master -> 0885a003c57a00b0f2dcee120cdbd2c84008ba10

bluegr bluegr at gmail.com
Mon Aug 19 05:31:58 CEST 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
0885a003c5 SCI: Fix bug #3614914 - "SCI: Castle of Dr Brain Spanish crashes after Computer Room"


Commit: 0885a003c57a00b0f2dcee120cdbd2c84008ba10
    https://github.com/scummvm/scummvm/commit/0885a003c57a00b0f2dcee120cdbd2c84008ba10
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2013-08-18T20:30:50-07:00

Commit Message:
SCI: Fix bug #3614914 - "SCI: Castle of Dr Brain Spanish crashes after Computer Room"

Ignore the unused x/y displacement fields of cels embedded in pics.
Dr. Brain Spanish, pic 261 contains garbage in these fields (probably
left overs)

Changed paths:
    engines/sci/graphics/picture.cpp



diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp
index af37264..91c7245 100644
--- a/engines/sci/graphics/picture.cpp
+++ b/engines/sci/graphics/picture.cpp
@@ -236,7 +236,9 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos
 	byte *ptr = NULL;
 	byte *headerPtr = inbuffer + headerPos;
 	byte *rlePtr = inbuffer + rlePos;
-	int16 displaceX, displaceY;
+	// displaceX, displaceY fields are ignored, and may contain garbage
+	// (e.g. pic 261 in Dr. Brain 1 Spanish - bug #3614914)
+	//int16 displaceX, displaceY;
 	byte priority = _addToFlag ? _priority : 0;
 	byte clearColor;
 	bool compression = true;
@@ -251,8 +253,8 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos
 		// Width/height here are always LE, even in Mac versions
 		width = READ_LE_UINT16(headerPtr + 0);
 		height = READ_LE_UINT16(headerPtr + 2);
-		displaceX = (signed char)headerPtr[4];
-		displaceY = (unsigned char)headerPtr[5];
+		//displaceX = (signed char)headerPtr[4];
+		//displaceY = (unsigned char)headerPtr[5];
 		if (_resourceType == SCI_PICTURE_TYPE_SCI11)
 			// SCI1.1 uses hardcoded clearcolor for pictures, even if cel header specifies otherwise
 			clearColor = _screen->getColorWhite();
@@ -262,16 +264,16 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos
 	} else {
 		width = READ_SCI11ENDIAN_UINT16(headerPtr + 0);
 		height = READ_SCI11ENDIAN_UINT16(headerPtr + 2);
-		displaceX = READ_SCI11ENDIAN_UINT16(headerPtr + 4); // probably signed?!?
-		displaceY = READ_SCI11ENDIAN_UINT16(headerPtr + 6); // probably signed?!?
+		//displaceX = READ_SCI11ENDIAN_UINT16(headerPtr + 4); // probably signed?!?
+		//displaceY = READ_SCI11ENDIAN_UINT16(headerPtr + 6); // probably signed?!?
 		clearColor = headerPtr[8];
 		if (headerPtr[9] == 0)
 			compression = false;
 	}
 #endif
 
-	if (displaceX || displaceY)
-		error("unsupported embedded cel-data in picture");
+	//if (displaceX || displaceY)
+	//	error("unsupported embedded cel-data in picture");
 
 	// We will unpack cel-data into a temporary buffer and then plot it to screen
 	//  That needs to be done cause a mirrored picture may be requested






More information about the Scummvm-git-logs mailing list