[Scummvm-cvs-logs] SF.net SVN: scummvm: [21248] scummvm/trunk/engines/scumm/gfx.cpp

kirben at users.sourceforge.net kirben at users.sourceforge.net
Sun Mar 12 18:23:03 CET 2006


Revision: 21248
Author:   kirben
Date:     2006-03-12 18:22:22 -0800 (Sun, 12 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21248&view=rev

Log Message:
-----------
Update and restore old debug code for masking

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/gfx.cpp
Modified: scummvm/trunk/engines/scumm/gfx.cpp
===================================================================
--- scummvm/trunk/engines/scumm/gfx.cpp	2006-03-12 23:21:01 UTC (rev 21247)
+++ scummvm/trunk/engines/scumm/gfx.cpp	2006-03-13 02:22:22 UTC (rev 21248)
@@ -1599,12 +1599,36 @@
 				}
 			}
 		}
+
+#if 0
+		// HACK: blit mask(s) onto normal screen. Useful to debug masking
+		for (i = 0; i < numzbuf; i++) {
+			byte *dst1, *dst2;
+
+			dst1 = dst2 = (byte *)vs->pixels + y * vs->pitch + (x + k) * 8;
+			if (vs->hasTwoBuffers)
+				dst2 = vs->backBuf + y * vs->pitch + (x + k) * 8;
+			mask_ptr = getMaskBuffer(x + k, y, i);
+
+			for (int h = 0; h < height; h++) {
+				int maskbits = *mask_ptr;
+				for (int j = 0; j < 8; j++) {
+					if (maskbits & 0x80)
+						dst1[j] = dst2[j] = 12 + i;
+					maskbits <<= 1;
+				}
+				dst1 += vs->pitch;
+				dst2 += vs->pitch;
+				mask_ptr += _numStrips;
+			}
+		}
+#endif
 	}
 }
 
 /**
  * Draw a bitmap onto a virtual screen. This is main drawing method for room backgrounds
- * used throughout in 7.2+ HE versions.
+ * used throughout in 71+ HE versions.
  *
  * @note This function essentially is a stripped down & special cased version of
  * the generic Gdi::drawBitmap() method.
@@ -1657,7 +1681,7 @@
 		return;
 
 	uint32 offs;
-	for (int stripnr = 0; stripnr < _numStrips; stripnr++)
+	for (int stripnr = 0; stripnr < _numStrips; stripnr++) {
 		for (int i = 1; i < numzbuf; i++) {
 			if (!zplane_list[i])
 				continue;
@@ -1670,6 +1694,28 @@
 				decompressMaskImg(mask_ptr, z_plane_ptr, vs->h);
 			}
 		}
+
+#if 0
+		// HACK: blit mask(s) onto normal screen. Useful to debug masking
+		for (int i = 0; i < numzbuf; i++) {
+			byte *dst1 = (byte *)vs->pixels + stripnr * 8;
+			byte *dst2 = vs->backBuf + stripnr * 8;
+
+			mask_ptr = getMaskBuffer(stripnr, 0, i);
+			for (int h = 0; h < vs->h; h++) {
+				int maskbits = *mask_ptr;
+				for (int j = 0; j < 8; j++) {
+					if (maskbits & 0x80)
+						dst1[j] = dst2[j] = 12 + i;
+					maskbits <<= 1;
+				}
+				dst1 += vs->pitch;
+				dst2 += vs->pitch;
+				mask_ptr += _numStrips;
+			}
+		}
+#endif
+	}
 }
 
 void Gdi::drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y, int w, int h) {


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