[Scummvm-cvs-logs] CVS: scummvm/scumm wiz_he.cpp,2.96.2.4,2.96.2.5

kirben kirben at users.sourceforge.net
Mon Nov 7 16:04:05 CET 2005


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

Modified Files:
      Tag: branch-0-8-0
	wiz_he.cpp 
Log Message:

Back port fillWizRect and fillWizLine fixes for issues in fun shop titles and spyozon.


Index: wiz_he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/wiz_he.cpp,v
retrieving revision 2.96.2.4
retrieving revision 2.96.2.5
diff -u -d -r2.96.2.4 -r2.96.2.5
--- wiz_he.cpp	22 Oct 2005 04:12:08 -0000	2.96.2.4
+++ wiz_he.cpp	8 Nov 2005 00:03:27 -0000	2.96.2.5
@@ -1557,28 +1557,33 @@
 		int w = READ_LE_UINT32(wizh + 0x4);
 		int h = READ_LE_UINT32(wizh + 0x8);
 		assert(c == 0);
-		Common::Rect r1(w, h);
+		Common::Rect areaRect, imageRect(w, h);
 		if (params->processFlags & kWPFClipBox) {
-			if (!r1.intersects(params->box)) {
+			if (!imageRect.intersects(params->box)) {
 				return;
 			}
-			r1.clip(params->box);
+			imageRect.clip(params->box);
 		}
 		if (params->processFlags & kWPFClipBox2) {
-			r1.clip(params->box2);
+			areaRect = params->box2;
+		} else {
+			areaRect = imageRect;
 		}
 		uint8 color = _vm->VAR(93);
 		if (params->processFlags & kWPFFillColor) {
 			color = params->fillColor;
 		}
-		uint8 *wizd = _vm->findWrappedBlock(MKID('WIZD'), dataPtr, state, 0);
-		assert(wizd);
-		int dx = r1.width();
-		int dy = r1.height();
-		wizd += r1.top * w + r1.left;
-		while (dy--) {
-			memset(wizd, color, dx);
-			wizd += w;
+		if (areaRect.intersects(imageRect)) {
+			areaRect.clip(imageRect);
+			uint8 *wizd = _vm->findWrappedBlock(MKID('WIZD'), dataPtr, state, 0);
+			assert(wizd);
+			int dx = areaRect.width();
+			int dy = areaRect.height();
+			wizd += areaRect.top * w + areaRect.left;
+			while (dy--) {
+				memset(wizd, color, dx);
+				wizd += w;
+			}
 		}
 	}
 }
@@ -1597,12 +1602,12 @@
 			int w = READ_LE_UINT32(wizh + 0x4);
 			int h = READ_LE_UINT32(wizh + 0x8);
 			assert(c == 0);
-			Common::Rect r1(w, h);
+			Common::Rect imageRect(w, h);
 			if (params->processFlags & kWPFClipBox) {
-				if (!r1.intersects(params->box)) {
+				if (!imageRect.intersects(params->box)) {
 					return;
 				}
-				r1.clip(params->box);
+				imageRect.clip(params->box);
 			}
 			uint8 color = _vm->VAR(93);
 			if (params->processFlags & kWPFFillColor) {
@@ -1630,7 +1635,10 @@
 				incy = -1;
 			}
 
-			if (r1.contains(x1, y1)) {
+			dx = ABS(x2 - x1);
+			dy = ABS(y2 - y1);
+
+			if (imageRect.contains(x1, y1)) {
 				*(wizd + y1 * w + x1) = color;
 			}
 
@@ -1646,7 +1654,7 @@
 						y1 += incy;
 					}
 					x1 += incx;
-					if (r1.contains(x1, y1)) {
+					if (imageRect.contains(x1, y1)) {
 						*(wizd + y1 * w + x1) = color;
 					}
 				}
@@ -1662,7 +1670,7 @@
 						x1 += incx;
 					}
 					y1 += incy;
-					if (r1.contains(x1, y1)) {
+					if (imageRect.contains(x1, y1)) {
 						*(wizd + y1 * w + x1) = color;
 					}
 				}





More information about the Scummvm-git-logs mailing list