[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.471.2.4,2.471.2.5 gfx.h,1.122.2.1,1.122.2.2 object.cpp,1.253.2.3,1.253.2.4

kirben kirben at users.sourceforge.net
Sun Jan 1 02:13:01 CET 2006


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24041/scumm

Modified Files:
      Tag: branch-0-8-0
	gfx.cpp gfx.h object.cpp 
Log Message:

Back port freddi2/3 fixes.


Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.471.2.4
retrieving revision 2.471.2.5
diff -u -d -r2.471.2.4 -r2.471.2.5
--- gfx.cpp	8 Nov 2005 22:15:51 -0000	2.471.2.4
+++ gfx.cpp	1 Jan 2006 10:12:01 -0000	2.471.2.5
@@ -1415,7 +1415,7 @@
 	int bottom;
 	int numzbuf;
 	int sx;
-	bool useOrDecompress = false;
+	bool transpStrip = false;
 
 	// Check whether lights are turned on or not
 	const bool lightsOn = _vm->isLightOn();
@@ -1536,7 +1536,7 @@
 				error("drawBitmap: Trying to draw a non-existant strip");
 				return;
 			}
-			useOrDecompress = decompressBitmap(dstPtr, vs->pitch, smap_ptr + offset, height);
+			transpStrip = decompressBitmap(dstPtr, vs->pitch, smap_ptr + offset, height);
 		}
 
 		CHECK_HEAP;
@@ -1551,7 +1551,7 @@
 
 		// COMI and HE games only uses flag value
 		if (_vm->_version == 8 || _vm->_heversion >= 60)
-			useOrDecompress = true;
+			transpStrip = true;
 
 		if (_vm->_version == 1) {
 			mask_ptr = getMaskBuffer(x + k, y, 1);
@@ -1585,7 +1585,7 @@
 				z_plane_ptr = zplane_list[1] + READ_LE_UINT16(zplane_list[1] + stripnr * 2 + 8);
 			for (i = 0; i < numzbuf; i++) {
 				mask_ptr = getMaskBuffer(x + k, y, i);
-				if (useOrDecompress && (flag & dbAllowMaskOr))
+				if (transpStrip && (flag & dbAllowMaskOr))
 					decompressMaskImgOr(mask_ptr, z_plane_ptr, height);
 				else
 					decompressMaskImg(mask_ptr, z_plane_ptr, height);
@@ -1616,14 +1616,14 @@
 					if (tmsk_ptr) {
 						const byte *tmsk = tmsk_ptr + READ_LE_UINT16(tmsk_ptr + 8);
 						decompressTMSK(mask_ptr, tmsk, z_plane_ptr, height);
-					} else if (useOrDecompress && (flag & dbAllowMaskOr)) {
+					} else if (transpStrip && (flag & dbAllowMaskOr)) {
 						decompressMaskImgOr(mask_ptr, z_plane_ptr, height);
 					} else {
 						decompressMaskImg(mask_ptr, z_plane_ptr, height);
 					}
 
 				} else {
-					if (!(useOrDecompress && (flag & dbAllowMaskOr)))
+					if (!(transpStrip && (flag & dbAllowMaskOr)))
 						for (int h = 0; h < height; h++)
 							mask_ptr[h * _numStrips] = 0;
 					// FIXME: needs better abstraction
@@ -1811,7 +1811,7 @@
 	}
 
 	byte code = *src++;
-	bool useOrDecompress = false;
+	bool transpStrip = false;
 	
 	if ((_vm->_platform == Common::kPlatformAmiga) && (_vm->_version >= 4))
 		_paletteMod = 16;
@@ -1821,7 +1821,7 @@
 	if (code <= 10) {
 		switch (code) {
 		case 1:
-			unkDecode7(dst, dstPitch, src, numLinesToProcess);
+			drawStripRaw(dst, dstPitch, src, numLinesToProcess, false);
 			break;
 	
 		case 2:
@@ -1842,7 +1842,7 @@
 	
 		case 8:
 			// Used in 3DO versions of HE games
-			useOrDecompress = true;
+			transpStrip = true;
 			drawStrip3DO(dst, dstPitch, src, numLinesToProcess, true);
 			break;
 	
@@ -1861,53 +1861,96 @@
 	} else {
 		_decomp_shr = code % 10;
 		_decomp_mask = 0xFF >> (8 - _decomp_shr);
-		code /= 10;
 		
 		switch (code) {
-		case 1:
+		case 14:
+		case 15:
+		case 16:
+		case 17:
+		case 18:
 			drawStripBasicV(dst, dstPitch, src, numLinesToProcess, false);
 			break;
 	
-		case 2:
+		case 24:
+		case 25:
+		case 26:
+		case 27:
+		case 28:
 			drawStripBasicH(dst, dstPitch, src, numLinesToProcess, false);
 			break;
 	
-		case 3:
-			useOrDecompress = true;
+		case 34:
+		case 35:
+		case 36:
+		case 37:
+		case 38:
+			transpStrip = true;
 			drawStripBasicV(dst, dstPitch, src, numLinesToProcess, true);
 			break;
 	
-		case 4:
-			useOrDecompress = true;
+		case 44:
+		case 45:
+		case 46:
+		case 47:
+		case 48:
+			transpStrip = true;
 			drawStripBasicH(dst, dstPitch, src, numLinesToProcess, true);
 			break;
 	
-		case 6:
-		case 10:
+		case 64:
+		case 65:
+		case 66:
+		case 67:
+		case 68:
+		case 104:
+		case 105:
+		case 106:
+		case 107:
+		case 108:
 			drawStripComplex(dst, dstPitch, src, numLinesToProcess, false);
 			break;
 	
-		case 8:
-		case 12:
-			useOrDecompress = true;
+		case 84:
+		case 85:
+		case 86:
+		case 87:
+		case 88:
+		case 124:
+		case 125:
+		case 126:
+		case 127:
+		case 128:
+			transpStrip = true;
 			drawStripComplex(dst, dstPitch, src, numLinesToProcess, true);
 			break;
 	
-		case 13:
+		case 134:
+		case 135:
+		case 136:
+		case 137:
+		case 138:
 			drawStripHE(dst, dstPitch, src, 8, numLinesToProcess, false);
 			break;
 	
-		case 14:
-			useOrDecompress = true;
+		case 144:
+		case 145:
+		case 146:
+		case 147:
+		case 148:
+			transpStrip = true;
 			drawStripHE(dst, dstPitch, src, 8, numLinesToProcess, true);
 			break;
+
+		case 149:
+			drawStripRaw(dst, dstPitch, src, numLinesToProcess, true);
+			break;
 	
 		default:
 			error("Gdi::decompressBitmap: default case %d", code);
 		}
 	}
 	
-	return useOrDecompress;
+	return transpStrip;
 }
 
 void Gdi::decompressMaskImg(byte *dst, const byte *src, int height) const {
@@ -2740,20 +2783,24 @@
 			}                              \
 		} while (0)
 
-void Gdi::unkDecode7(byte *dst, int dstPitch, const byte *src, int height) const {
+void Gdi::drawStripRaw(byte *dst, int dstPitch, const byte *src, int height, const bool transpCheck) const {
+	int x;
 
 	if (_vm->_features & GF_OLD256) {
 		uint h = height;
-		int x = 8;
+		x = 8;
 		for (;;) {
 			*dst = *src++;
 			NEXT_ROW;
 		}
 	} else {
 		do {
-			memcpy(dst, src, 8);
+			for (x = 0; x < 8; x ++) {
+				byte color = *src++;
+				if (!transpCheck || color != _transparentColor)
+					dst[x] = _roomPalette[color] + _paletteMod;
+			}
 			dst += dstPitch;
-			src += 8;
 		} while (--height);
 	}
 }

Index: gfx.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.h,v
retrieving revision 1.122.2.1
retrieving revision 1.122.2.2
diff -u -d -r1.122.2.1 -r1.122.2.2
--- gfx.h	18 Oct 2005 02:11:21 -0000	1.122.2.1
+++ gfx.h	1 Jan 2006 10:12:01 -0000	1.122.2.2
@@ -245,7 +245,7 @@
 	void drawStripBasicH(byte *dst, int dstPitch, const byte *src, int height, const bool transpCheck) const;
 	void drawStripBasicV(byte *dst, int dstPitch, const byte *src, int height, const bool transpCheck) const;
 
-	void unkDecode7(byte *dst, int dstPitch, const byte *src, int height) const;
+	void drawStripRaw(byte *dst, int dstPitch, const byte *src, int height, const bool transpCheck) const;
 	void unkDecode8(byte *dst, int dstPitch, const byte *src, int height) const;
 	void unkDecode9(byte *dst, int dstPitch, const byte *src, int height) const;
 	void unkDecode10(byte *dst, int dstPitch, const byte *src, int height) const;

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.253.2.3
retrieving revision 1.253.2.4
diff -u -d -r1.253.2.3 -r1.253.2.4
--- object.cpp	25 Oct 2005 02:50:16 -0000	1.253.2.3
+++ object.cpp	1 Jan 2006 10:12:01 -0000	1.253.2.4
@@ -431,7 +431,8 @@
 	MKID('IM0C'),
 	MKID('IM0D'),
 	MKID('IM0E'),
-	MKID('IM0F')
+	MKID('IM0F'),
+	MKID('IM10')
 };
 
 void ScummEngine::drawObject(int obj, int arg) {





More information about the Scummvm-git-logs mailing list