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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Tue May 25 14:53:36 CEST 2010


Revision: 49213
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49213&view=rev
Author:   m_kiewitz
Date:     2010-05-25 12:53:35 +0000 (Tue, 25 May 2010)

Log Message:
-----------
SCI: sci1.1 uses hardcoded white for picture cel data instead of the value specified in header - fixes pixel glitches in island of dr. brain title, sq4 title and qfg3 room during intro

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

Modified: scummvm/trunk/engines/sci/graphics/picture.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/picture.cpp	2010-05-25 12:04:32 UTC (rev 49212)
+++ scummvm/trunk/engines/sci/graphics/picture.cpp	2010-05-25 12:53:35 UTC (rev 49213)
@@ -111,7 +111,7 @@
 
 	// display Cel-data
 	if (has_cel)
-		drawCelData(inbuffer, size, cel_headerPos, cel_RlePos, cel_LiteralPos, 0, 0, false);
+		drawCelData(inbuffer, size, cel_headerPos, cel_RlePos, cel_LiteralPos, 0, 0, SCI_PICTURE_CELTYPE_SCI11);
 
 	// process vector data
 	drawVectorData(inbuffer + vector_dataPos, vector_size);
@@ -156,14 +156,14 @@
 		cel_LiteralPos = READ_LE_UINT32(inbuffer + cel_headerPos + 28);
 		cel_relXpos = READ_LE_UINT16(inbuffer + cel_headerPos + 38);
 		cel_relYpos = READ_LE_UINT16(inbuffer + cel_headerPos + 40);
-		drawCelData(inbuffer, size, cel_headerPos, cel_RlePos, cel_LiteralPos, cel_relXpos, cel_relYpos, true);
+		drawCelData(inbuffer, size, cel_headerPos, cel_RlePos, cel_LiteralPos, cel_relXpos, cel_relYpos, SCI_PICTURE_CELTYPE_SCI32);
 		cel_headerPos += 42;
 		celCount--;
 	}
 }
 #endif
 
-void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos, int literalPos, int16 callerX, int16 callerY, bool hasSci32Header) {
+void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos, int literalPos, int16 callerX, int16 callerY, int celType) {
 	byte *celBitmap = NULL;
 	byte *ptr = NULL;
 	byte *headerPtr = inbuffer + headerPos;
@@ -180,11 +180,16 @@
 	int pixelNr, pixelCount;
 
 #ifdef ENABLE_SCI32
-	if (!hasSci32Header) {
+	if (celType != SCI_PICTURE_CELTYPE_SCI32) {
 #endif
 		displaceX = (signed char)headerPtr[4];
 		displaceY = (unsigned char)headerPtr[5];
-		clearColor = headerPtr[6];
+		if (celType == SCI_PICTURE_CELTYPE_SCI11) {
+			// SCI1.1 uses hardcoded clearcolor for pictures, even if cel header specifies otherwise
+			clearColor = _screen->getColorWhite();
+		} else {
+			clearColor = headerPtr[6];
+		}
 #ifdef ENABLE_SCI32
 	} else {
 		displaceX = READ_LE_UINT16(headerPtr + 4); // probably signed?!?
@@ -586,7 +591,7 @@
 					vectorGetAbsCoordsNoMirror(data, curPos, x, y);
 					size = READ_LE_UINT16(data + curPos); curPos += 2;
 					_priority = pic_priority; // set global priority so the cel gets drawn using current priority as well
-					drawCelData(data, _resource->size, curPos, curPos + 8, 0, x, y, false);
+					drawCelData(data, _resource->size, curPos, curPos + 8, 0, x, y, SCI_PICTURE_CELTYPE_REGULAR);
 					curPos += size;
 					break;
 				case PIC_OPX_EGA_SET_PRIORITY_TABLE:
@@ -628,7 +633,7 @@
 					_priority = pic_priority; // set global priority so the cel gets drawn using current priority as well
 					if (pic_priority == 255)
 						_priority = 0; // if priority not set, use priority 0
-					drawCelData(data, _resource->size, curPos, curPos + 8, 0, x, y, false);
+					drawCelData(data, _resource->size, curPos, curPos + 8, 0, x, y, SCI_PICTURE_CELTYPE_REGULAR);
 					curPos += size;
 					break;
 				case PIC_OPX_VGA_PRIORITY_TABLE_EQDIST:

Modified: scummvm/trunk/engines/sci/graphics/picture.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/picture.h	2010-05-25 12:04:32 UTC (rev 49212)
+++ scummvm/trunk/engines/sci/graphics/picture.h	2010-05-25 12:53:35 UTC (rev 49213)
@@ -32,6 +32,12 @@
 #define SCI_PATTERN_CODE_USE_TEXTURE 0x20
 #define SCI_PATTERN_CODE_PENSIZE 0x07
 
+enum {
+	SCI_PICTURE_CELTYPE_REGULAR		= 0,
+	SCI_PICTURE_CELTYPE_SCI11		= 1,
+	SCI_PICTURE_CELTYPE_SCI32		= 2
+};
+
 class GfxPorts;
 class GfxScreen;
 class GfxPalette;
@@ -57,7 +63,7 @@
 	void initData(GuiResourceId resourceId);
 	void reset();
 	void drawSci11Vga();
-	void drawCelData(byte *inbuffer, int size, int headerPos, int rlePos, int literalPos, int16 callerX, int16 callerY, bool hasSci32Header);
+	void drawCelData(byte *inbuffer, int size, int headerPos, int rlePos, int literalPos, int16 callerX, int16 callerY, int celType);
 	void drawVectorData(byte *data, int size);
 	bool vectorIsNonOpcode(byte pixel);
 	void vectorGetAbsCoords(byte *data, int &curPos, int16 &x, int16 &y);


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