[Scummvm-cvs-logs] SF.net SVN: scummvm:[43625] scummvm/trunk/engines/scumm/he

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Sat Aug 22 02:27:01 CEST 2009


Revision: 43625
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43625&view=rev
Author:   Kirben
Date:     2009-08-22 00:27:01 +0000 (Sat, 22 Aug 2009)

Log Message:
-----------
Exclude 16bit specific code, when 16bit support is disabled.

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/he/wiz_he.cpp
    scummvm/trunk/engines/scumm/he/wiz_he.h

Modified: scummvm/trunk/engines/scumm/he/wiz_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/wiz_he.cpp	2009-08-22 00:20:33 UTC (rev 43624)
+++ scummvm/trunk/engines/scumm/he/wiz_he.cpp	2009-08-22 00:27:01 UTC (rev 43625)
@@ -369,6 +369,7 @@
 	}
 }
 
+#ifdef USE_RGB_COLOR
 void Wiz::copy16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *xmapPtr) {
 	Common::Rect r1, r2;
 	if (calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, r1, r2)) {
@@ -388,6 +389,7 @@
 		}
 	}
 }
+#endif
 
 void Wiz::copyWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitDepth) {
 	Common::Rect r1, r2;
@@ -445,6 +447,7 @@
 	}
 }
 
+#ifdef USE_RGB_COLOR
 void Wiz::copyMaskWizImage(uint8 *dst, const uint8 *src, const uint8 *mask, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr) {
 	Common::Rect srcRect, dstRect;
 	if (!calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, srcRect, dstRect)) {
@@ -531,6 +534,7 @@
 		maskPtr = maskPtrNext;
 	}
 }
+#endif
 
 void Wiz::copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstPitch, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int maskT, int maskP) {
 	Common::Rect srcRect, dstRect;
@@ -621,7 +625,8 @@
 	}
 }
 
-void Wiz::copyRawWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor, uint8 bitDepth) {
+#ifdef USE_RGB_COLOR
+void Wiz::copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, int transColor) {
 	Common::Rect r1, r2;
 	if (calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, r1, r2)) {
 		if (flags & kWIFFlipX) {
@@ -638,17 +643,23 @@
 		}
 		int h = r1.height();
 		int w = r1.width();
-		src += r1.top * srcw + r1.left;
-		dst += r2.top * dstPitch + r2.left * bitDepth;
-		if (palPtr) {
-			decompressRawWizImage<kWizRMap>(dst, dstPitch, dstType, src, srcw, w, h, transColor, palPtr, bitDepth);
-		} else {
-			decompressRawWizImage<kWizCopy>(dst, dstPitch, dstType, src, srcw, w, h, transColor, NULL, bitDepth);
+		src += (r1.top * srcw + r1.left) * 2;
+		dst += r2.top * dstPitch + r2.left * 2;
+		while (h--) {
+			for (int i = 0; i < w; ++ i) {
+				uint16 col = READ_LE_UINT16(src + 2 * i);
+				if (transColor == -1 || transColor != col) {
+					writeColor(dst + i * 2, dstType, col);
+				}
+			}
+			src += srcw * 2;
+			dst += dstPitch;
 		}
 	}
 }
+#endif
 
-void Wiz::copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, int transColor) {
+void Wiz::copyRawWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor, uint8 bitDepth) {
 	Common::Rect r1, r2;
 	if (calcClipRects(dstw, dsth, srcx, srcy, srcw, srch, rect, r1, r2)) {
 		if (flags & kWIFFlipX) {
@@ -665,21 +676,17 @@
 		}
 		int h = r1.height();
 		int w = r1.width();
-		src += (r1.top * srcw + r1.left) * 2;
-		dst += r2.top * dstPitch + r2.left * 2;
-		while (h--) {
-			for (int i = 0; i < w; ++ i) {
-				uint16 col = READ_LE_UINT16(src + 2 * i);
-				if (transColor == -1 || transColor != col) {
-					writeColor(dst + i * 2, dstType, col);
-				}
-			}
-			src += srcw * 2;
-			dst += dstPitch;
+		src += r1.top * srcw + r1.left;
+		dst += r2.top * dstPitch + r2.left * bitDepth;
+		if (palPtr) {
+			decompressRawWizImage<kWizRMap>(dst, dstPitch, dstType, src, srcw, w, h, transColor, palPtr, bitDepth);
+		} else {
+			decompressRawWizImage<kWizCopy>(dst, dstPitch, dstType, src, srcw, w, h, transColor, NULL, bitDepth);
 		}
 	}
 }
 
+#ifdef USE_RGB_COLOR
 template <int type>
 void Wiz::write16BitColor(uint8 *dstPtr, const uint8 *dataPtr, int dstType, const uint8 *xmapPtr) {
 	uint16 col = READ_LE_UINT16(dataPtr);
@@ -795,6 +802,7 @@
 		dstPtr = dstPtrNext;
 	}
 }
+#endif
 
 template <int type>
 void Wiz::write8BitColor(uint8 *dstPtr, const uint8 *dataPtr, int dstType, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitDepth) {
@@ -1149,6 +1157,7 @@
 	}
 }
 
+#ifdef USE_RGB_COLOR
 static int wizPackType2(uint8 *dst, const uint8 *src, int srcPitch, const Common::Rect& rCapt) {
 	debug(9, "wizPackType2([%d,%d,%d,%d])", rCapt.left, rCapt.top, rCapt.right, rCapt.bottom);
 	int w = rCapt.width();
@@ -1165,6 +1174,7 @@
 	}
 	return size;
 }
+#endif
 
 static int wizPackType1(uint8 *dst, const uint8 *src, int srcPitch, const Common::Rect& rCapt, uint8 transColor) {
 	debug(9, "wizPackType1(%d, [%d,%d,%d,%d])", transColor, rCapt.left, rCapt.top, rCapt.right, rCapt.bottom);
@@ -1341,9 +1351,11 @@
 		case 1:
 			dataSize = wizPackType1(0, src, srcPitch, rCapt, transColor);
 			break;
+#ifdef USE_RGB_COLOR
 		case 2:
 			dataSize = wizPackType2(0, src, srcPitch, rCapt);
 			break;
+#endif
 		default:
 			error("unhandled compression type %d", compType);
 			break;
@@ -1387,9 +1399,11 @@
 		case 1:
 			wizPackType1(wizImg + headerSize, src, srcPitch, rCapt, transColor);
 			break;
+#ifdef USE_RGB_COLOR
 		case 2:
 			wizPackType2(wizImg + headerSize, src, srcPitch, rCapt);
 			break;
+#endif
 		default:
 			break;
 		}
@@ -1566,6 +1580,7 @@
 			copyWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr, xmapPtr, _vm->_bitDepth);
 		}
 		break;
+#ifdef USE_RGB_COLOR
 	case 2:
 		if (maskNum) {
 			copyMaskWizImage(dst, wizd, mask, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, palPtr);
@@ -1579,6 +1594,7 @@
 	case 5:
 		copy16BitWizImage(dst, wizd, dstPitch, dstType, cw, ch, x1, y1, width, height, &rScreen, flags, xmapPtr);
 		break;
+#endif
 	default:
 		error("drawWizImage: Unhandled wiz compression type %d", comp);
 	}
@@ -2582,6 +2598,7 @@
 		case 1:
 			ret = isWizPixelNonTransparent(wizd, x, y, w, h, 1);
 			break;
+#ifdef USE_RGB_COLOR
 		case 2:
 			ret = getRawWizPixelColor(wizd, x, y, w, h, 2, _vm->VAR(_vm->VAR_WIZ_TCOLOR)) != _vm->VAR(_vm->VAR_WIZ_TCOLOR) ? 1 : 0;
 			break;
@@ -2593,6 +2610,7 @@
 		case 5:
 			ret = isWizPixelNonTransparent(wizd, x, y, w, h, 2);
 			break;
+#endif
 		default:
 			error("isWizPixelNonTransparent: Unhandled wiz compression type %d", c);
 			break;
@@ -2623,6 +2641,7 @@
 	case 1:
 		color = getWizPixelColor(wizd, x, y, w, h, 1, _vm->VAR(_vm->VAR_WIZ_TCOLOR));
 		break;
+#ifdef USE_RGB_COLOR
 	case 2:
 		color = getRawWizPixelColor(wizd, x, y, w, h, 2, _vm->VAR(_vm->VAR_WIZ_TCOLOR));
 		break;
@@ -2633,6 +2652,7 @@
 	case 5:
 		color = getWizPixelColor(wizd, x, y, w, h, 2, _vm->VAR(_vm->VAR_WIZ_TCOLOR));
 		break;
+#endif
 	default:
 		error("getWizPixelColor: Unhandled wiz compression type %d", c);
 		break;

Modified: scummvm/trunk/engines/scumm/he/wiz_he.h
===================================================================
--- scummvm/trunk/engines/scumm/he/wiz_he.h	2009-08-22 00:20:33 UTC (rev 43624)
+++ scummvm/trunk/engines/scumm/he/wiz_he.h	2009-08-22 00:27:01 UTC (rev 43625)
@@ -209,19 +209,25 @@
 	void drawWizPolygonTransform(int resNum, int state, Common::Point *wp, int flags, int shadow, int dstResNum, int palette);
 	void drawWizPolygonImage(uint8 *dst, const uint8 *src, const uint8 *mask, int dstpitch, int dstType, int dstw, int dsth, int wizW, int wizH, Common::Rect &bound, Common::Point *wp, uint8 bitDepth);
 
+#ifdef USE_RGB_COLOR
 	static void copyMaskWizImage(uint8 *dst, const uint8 *src, const uint8 *mask, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr);
+#endif
 
 	static void copyAuxImage(uint8 *dst1, uint8 *dst2, const uint8 *src, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, uint8 bitdepth);
 	static void copyWizImageWithMask(uint8 *dst, const uint8 *src, int dstPitch, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int maskT, int maskP);
 	static void copyWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitdepth);
 	static void copyRawWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *palPtr, int transColor, uint8 bitdepth);
+#ifdef USE_RGB_COLOR
 	static void copy16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, const uint8 *xmapPtr);
 	static void copyRaw16BitWizImage(uint8 *dst, const uint8 *src, int dstPitch, int dstType, int dstw, int dsth, int srcx, int srcy, int srcw, int srch, const Common::Rect *rect, int flags, int transColor);
 	template<int type> static void decompress16BitWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *xmapPtr = NULL);
+#endif
 	template<int type> static void decompressWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, const Common::Rect &srcRect, int flags, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitdepth);
 	template<int type> static void decompressRawWizImage(uint8 *dst, int dstPitch, int dstType, const uint8 *src, int srcPitch, int w, int h, int transColor, const uint8 *palPtr, uint8 bitdepth);
 
+#ifdef USE_RGB_COLOR
 	template<int type> static void write16BitColor(uint8 *dst, const uint8 *src, int dstType, const uint8 *xmapPtr);
+#endif
 	template<int type> static void write8BitColor(uint8 *dst, const uint8 *src, int dstType, const uint8 *palPtr, const uint8 *xmapPtr, uint8 bitDepth);
 	static void writeColor(uint8 *dstPtr, int dstType, uint16 color);
 


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