[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,1.28,1.29 object.cpp,1.5,1.6

James Brown ender at users.sourceforge.net
Fri Oct 11 04:51:02 CEST 2002


Update of /cvsroot/scummvm/scummvm/scumm
In directory usw-pr-cvs1:/tmp/cvs-serv18919/scumm

Modified Files:
	gfx.cpp object.cpp 
Log Message:
Patch 621733: drawBomp() masking


Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- gfx.cpp	1 Oct 2002 16:58:26 -0000	1.28
+++ gfx.cpp	11 Oct 2002 11:50:06 -0000	1.29
@@ -1838,8 +1838,8 @@
 		lp = (left >> 3) + _screenStartStrip;
 		if (lp < 0)
 			lp = 0;
-		if (rp >= _realHeight)
-			rp = _realHeight;
+		if (rp >= 200)
+			rp = 200;
 		if (lp <= rp) {
 			num = rp - lp + 1;
 			sp = &gfxUsageBits[lp];
@@ -3194,6 +3194,7 @@
 	int src_x, src_y, dst_x, dst_y;
 	uint scaled_width, scaled_height;
 	int h = bd->srcheight;
+	byte *mask = NULL;
 	uint i;
 
 	if (h == 0 || bd->srcwidth == 0)
@@ -3217,6 +3218,11 @@
 		}
 	}
 
+	// We take charset masking into consideration, because otherwise the
+	// inventory window in The Dig may overwrite text.
+
+	mask = getResourceAddress(rtBuffer, 9) + _screenStartStrip;
+	
 	// Select which rows and columns from the original to show in the
 	// scaled version of the image. This is a pretty stupid way of scaling
 	// images, but it will have to do for now.
@@ -3267,8 +3273,11 @@
 				color = *src++;
 				for (i = 0; i < num; i++) {
 					if (bd->scale_x == 255 || scale_cols[src_x]) {
-						if (dst_x >= 0 && dst_x < bd->outwidth)
-							*d = blend(_currentPalette, color, *d);
+						if (dst_x >= 0 && dst_x < bd->outwidth) {
+							if (!(*(mask + dst_y * 40 + (dst_x >> 3)) & revBitMask[dst_x & 7]))
+							
+								*d = blend(_currentPalette, color, *d);
+						}
 						d++;
 						dst_x++;
 					}
@@ -3278,7 +3287,8 @@
 				for (i = 0; i < num; i++) {
 					if (bd->scale_x == 255 || scale_cols[src_x]) {
 						if (dst_x >= 0 && dst_x < bd->outwidth)
-							*d = blend(_currentPalette, src[i], *d);
+							if (!(*(mask + dst_y * 40 + (dst_x >> 3)) & revBitMask[dst_x & 7]))
+								*d = blend(_currentPalette, src[i], *d);
 						d++;
 						dst_x++;
 					}

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- object.cpp	29 Sep 2002 15:20:02 -0000	1.5
+++ object.cpp	11 Oct 2002 11:50:06 -0000	1.6
@@ -1268,7 +1268,41 @@
 
 void Scumm::removeBlastObject(BlastObject *eo)
 {
-	restoreBG(eo->posX, eo->posY, eo->posX + eo->width, eo->posY + eo->height);
+	VirtScreen *vs = &virtscr[0];
+
+	int top, bottom, left, right;
+	int left_strip, right_strip;
+	int i;
+
+	top = eo->posY;
+	bottom = eo->posY + eo->height;
+	left = eo->posX;
+	right = eo->posX + eo->width;
+
+	if (bottom < 0 || right < 0 || top > vs->height || left > vs->width)
+		return;
+
+	if (top < 0)
+		top = 0;
+	if (bottom > vs->height)
+		bottom = vs->height;
+	if (left < 0)
+		left = 0;
+	if (right > vs->width)
+		right = vs->width;
+
+	left_strip = left >> 3;
+	right_strip = (right >> 3) + 1;
+
+	if (left_strip < 0)
+		left_strip = 0;
+	if (right_strip >= 200)
+		right_strip = 200;
+
+	for (i = left_strip; i <= right_strip; i++)
+		gdi.resetBackground(top, bottom, i);
+
+	updateDirtyRect(0, left, right, top, bottom, 0x40000000);
 }
 
 int Scumm::findFlObjectSlot()





More information about the Scummvm-git-logs mailing list