[Scummvm-cvs-logs] CVS: scummvm/scumm akos.cpp,1.244,1.245 charset.cpp,2.157,2.158 wiz_he.cpp,2.105,2.106 wiz_he.h,2.34,2.35

kirben kirben at users.sourceforge.net
Sat Nov 5 05:06:08 CET 2005


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

Modified Files:
	akos.cpp charset.cpp wiz_he.cpp wiz_he.h 
Log Message:

Detect where wizImage type 1 should be flipped.
Show images without zoom or angle in ski ride of pajama3 for now.


Index: akos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/akos.cpp,v
retrieving revision 1.244
retrieving revision 1.245
diff -u -d -r1.244 -r1.245
--- akos.cpp	30 Oct 2005 02:22:53 -0000	1.244
+++ akos.cpp	5 Nov 2005 13:05:51 -0000	1.245
@@ -1334,9 +1334,9 @@
 
 	byte *dstPtr = (byte *)_out.pixels + dst.left + dst.top * _out.pitch;
 	if (_shadow_mode == 3) {
-		Wiz::decompressWizImage(dstPtr, _out.pitch, dst, _srcptr, src, palPtr, xmap);
+		Wiz::decompressWizImage(dstPtr, _out.pitch, dst, _srcptr, src, 0, palPtr, xmap);
 	} else {
-		Wiz::decompressWizImage(dstPtr, _out.pitch, dst, _srcptr, src, palPtr);
+		Wiz::decompressWizImage(dstPtr, _out.pitch, dst, _srcptr, src, 0, palPtr);
 	}
 #endif
 	return 0;

Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.157
retrieving revision 2.158
diff -u -d -r2.157 -r2.158
--- charset.cpp	4 Nov 2005 23:52:01 -0000	2.157
+++ charset.cpp	5 Nov 2005 13:05:52 -0000	2.158
@@ -1427,7 +1427,7 @@
 			byte imagePalette[256];
 			memset(imagePalette, 0, sizeof(imagePalette));
 			memcpy(imagePalette, _vm->_charsetColorMap, 16);
-			Wiz::copyWizImage(dstPtr, charPtr, vs->w, vs->h, _left, _top, origWidth, origHeight, &rScreen, imagePalette);
+			Wiz::copyWizImage(dstPtr, charPtr, vs->w, vs->h, _left, _top, origWidth, origHeight, &rScreen, 0, imagePalette);
 		} else {
 			Wiz::copyWizImage(dstPtr, charPtr, vs->w, vs->h, _left, _top, origWidth, origHeight, &rScreen);
 		}

Index: wiz_he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/wiz_he.cpp,v
retrieving revision 2.105
retrieving revision 2.106
diff -u -d -r2.105 -r2.106
--- wiz_he.cpp	4 Nov 2005 10:21:16 -0000	2.105
+++ wiz_he.cpp	5 Nov 2005 13:05:52 -0000	2.106
@@ -311,11 +311,11 @@
 	return srcRect.isValidRect() && dstRect.isValidRect();
 }
 
-void Wiz::copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, const uint8 *palPtr, const uint8 *xmapPtr) {
+void Wiz::copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, const uint8 *xmapPtr) {
 	Common::Rect r1, r2;
 	if (calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, r1, r2)) {
 		dst += r2.left + r2.top * dstw;
-		decompressWizImage(dst, dstw, r2, src, r1, palPtr, xmapPtr);
+		decompressWizImage(dst, dstw, r2, src, r1, flags, palPtr, xmapPtr);
 	}
 }
 
@@ -406,7 +406,14 @@
 	}
 }
 
-void Wiz::decompressWizImage(uint8 *dst, int dstPitch, const Common::Rect &dstRect, const uint8 *src, const Common::Rect &srcRect, const uint8 *palPtr, const uint8 *xmapPtr) {
+void Wiz::decompressWizImage(uint8 *dst, int dstPitch, const Common::Rect &dstRect, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr, const uint8 *xmapPtr) {
+	if (flags & kWIFFlipX) {
+		debug(0, "decompressWizImage: Unhandled flag kWIFFlipX");
+	}
+	if (flags & kWIFFlipY) {
+		debug(0, "decompressWizImage: Unhandled flag kWIFFlipY");
+	}
+
 	const uint8 *dataPtr, *dataPtrNext;
 	uint8 *dstPtr, *dstPtrNext;
 	uint32 code;
@@ -1059,14 +1066,14 @@
 		break;
 	case 1:
 		// TODO Adding masking for flags 0x80 and 0x100
-		if (flags & 0x80) {
+		if (flags & 0x80)
 			// Used in maze
 			debug(0, "drawWizImage: Unhandled flag 0x80");
-		} else if (flags & 0x100) {
+		if (flags & 0x100) {
 			// Used in readdemo
 			debug(0, "drawWizImage: Unhandled flag 0x100");
 		}
-		copyWizImage(dst, wizd, cw, ch, x1, y1, width, height, &rScreen, palPtr, xmapPtr);
+		copyWizImage(dst, wizd, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, xmapPtr);
 		break;
 	case 2:
 		copyRaw16BitWizImage(dst, wizd, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, color);
@@ -1181,10 +1188,16 @@
 		pts[i].y += po_y;
 	}
 
+	Common::Rect bounds;
+	polygonCalcBoundBox(pts, 4, bounds);
+	int x1 = bounds.left;
+	int y1 = bounds.top;
+
 	if (scale != 256) {
 		debug(1, "drawWizComplexPolygon() scale not implemented");
-
 		//drawWizPolygonTransform(resNum, state, pts, flags, VAR(VAR_WIZ_TCOLOR), r, dstPtr, palette, xmapPtr);
+
+		drawWizImage(resNum, state, x1, y1, 0, shadow, 0, r, flags, dstResNum, palette);
 	} else {
 		debug(1, "drawWizComplexPolygon() angle partially implemented");
 
@@ -1193,15 +1206,12 @@
 			angle += 360;
 		}
 
-		Common::Rect bounds;
-		polygonCalcBoundBox(pts, 4, bounds);
-		int x1 = bounds.left;
-		int y1 = bounds.top;
-
 		switch(angle) {
 		case 270:
 			flags |= kWIFFlipX | kWIFFlipY;
 			//drawWizComplexPolygonHelper(resNum, state, x1, y1, r, flags, dstResNum, palette);
+
+			drawWizImage(resNum, state, x1, y1, 0, shadow, 0, r, flags, dstResNum, palette);
 			break;
 		case 180:
 			flags |= kWIFFlipX | kWIFFlipY;
@@ -1209,12 +1219,16 @@
 			break;
 		case 90:
 			//drawWizComplexPolygonHelper(resNum, state, x1, y1, r, flags, dstResNum, palette);
+
+			drawWizImage(resNum, state, x1, y1, 0, shadow, 0, r, flags, dstResNum, palette);
 			break;
 		case 0:
 			drawWizImage(resNum, state, x1, y1, 0, shadow, 0, r, flags, dstResNum, palette);
 			break;
 		default:
 			//drawWizPolygonTransform(resNum, state, pts, flags, VAR(VAR_WIZ_TCOLOR), r, dstResNum, palette, xmapPtr);
+
+			drawWizImage(resNum, state, x1, y1, 0, shadow, 0, r, flags, dstResNum, palette);
 			break;
 		}
 	}

Index: wiz_he.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/wiz_he.h,v
retrieving revision 2.34
retrieving revision 2.35
diff -u -d -r2.34 -r2.35
--- wiz_he.h	1 Nov 2005 00:52:25 -0000	2.34
+++ wiz_he.h	5 Nov 2005 13:05:52 -0000	2.35
@@ -187,10 +187,10 @@
 	void processWizImage(const WizParameters *params);
 
 	static void copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch);
-	static void copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL);
+	static void copyWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags = 0, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL);
 	static void copyRawWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor);
 	static void copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor);
-	static void decompressWizImage(uint8 *dst, int dstPitch, const Common::Rect &dstRect, const uint8 *src, const Common::Rect &srcRect, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL);
+	static void decompressWizImage(uint8 *dst, int dstPitch, const Common::Rect &dstRect, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr = NULL, const uint8 *xmapPtr = NULL);
 	int isWizPixelNonTransparent(const uint8 *data, int x, int y, int w, int h);
 	uint8 getWizPixelColor(const uint8 *data, int x, int y, int w, int h, uint8 color);
 	uint8 getRawWizPixelColor(const uint8 *data, int x, int y, int w, int h, uint8 color);





More information about the Scummvm-git-logs mailing list