[Scummvm-cvs-logs] CVS: scummvm/scumm charset.cpp,2.9,2.10 nut_renderer.cpp,1.11,1.12 script_v8.cpp,2.87,2.88

Max Horn fingolfin at users.sourceforge.net
Tue Dec 31 12:53:02 CET 2002


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv3065

Modified Files:
	charset.cpp nut_renderer.cpp script_v8.cpp 
Log Message:
added masking to nut charset renderer

Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.9
retrieving revision 2.10
diff -u -d -r2.9 -r2.10
--- charset.cpp	30 Dec 2002 13:55:36 -0000	2.9
+++ charset.cpp	31 Dec 2002 20:52:11 -0000	2.10
@@ -450,6 +450,7 @@
 	int width = _current->getCharWidth(chr);
 	int height = _current->getCharHeight(chr);
 
+	_hasMask = true;
 	_current->drawChar((char)chr, _left, _top, _color);
 	_vm->updateDirtyRect(0, _left, _left + width, _top, _top + height, 0);
 

Index: nut_renderer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/nut_renderer.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- nut_renderer.cpp	31 Dec 2002 20:17:46 -0000	1.11
+++ nut_renderer.cpp	31 Dec 2002 20:52:11 -0000	1.12
@@ -199,6 +199,11 @@
 
 	byte * src = (byte*)(_dataSrc + _offsets[c] + 14);
 	byte * dst = _vm->virtscr[0].screenPtr + y * _vm->_realWidth + x + _vm->virtscr[0].xstart;
+	byte *mask = _vm->getResourceAddress(rtBuffer, 9)
+					+ (y * _vm->_realWidth + x) / 8 + _vm->_screenStartStrip;
+	byte maskmask;
+	int maskpos;
+
 	uint32 length = READ_BE_UINT32(_dataSrc + _offsets[c] - 4) - 14;
 
 	decodeCodec44(_tmpCodecBuffer, src, length);
@@ -206,8 +211,10 @@
 
 	int32 width = READ_LE_UINT16(_dataSrc + _offsets[c] + 6);
 	int32 height = READ_LE_UINT16(_dataSrc + _offsets[c] + 8);
-
+	
 	for (int32 ty = 0; ty < height; ty++) {
+		maskmask = revBitMask[x & 7];
+		maskpos = 0;
 		for (int32 tx = 0; tx < width; tx++) {
 			byte pixel = *src++;
 #if 1
@@ -218,9 +225,12 @@
 			// in addition to the normal font. Or maybe the created the shadows dynamically
 			// on the fly: if we draw the character several times in black, moved a bit
 			// each time, that would mostly create the shadow effect. But why would they
-			// do this, as it would increase the char drawing time by factor 5-6 ?
-			if (pixel != 0)
+			// do this, as it would increase the char drawing time by factor 5-6 ? And in
+			// fact, even then the shadow would not be 100% right.
+			if (pixel != 0) {
+				mask[maskpos] |= maskmask;
 				dst[tx] = color;
+			}
 #else
 			if (pixel != 0) {
 				if (pixel == 0x01)
@@ -230,7 +240,13 @@
 				dst[tx] = pixel;
 			}
 #endif
+			maskmask >>= 1;
+			if (maskmask == 0) {
+				maskmask = 0x80;
+				maskpos++;
+			}
 		}
 		dst += _vm->_realWidth;
+		mask += _vm->gdi._numStrips;
 	}
 }

Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.87
retrieving revision 2.88
diff -u -d -r2.87 -r2.88
--- script_v8.cpp	31 Dec 2002 18:21:01 -0000	2.87
+++ script_v8.cpp	31 Dec 2002 20:52:11 -0000	2.88
@@ -962,12 +962,12 @@
 		c = pop();
 		b = pop();
 		a = pop();
-		warning("o8_roomOps: SO_ROOM_SATURATION(%d, %d, %d, %d, %d)", a, b, c, d, e);
 		// FIXME - this probably has the same format as for darkenPalette:
 		// thre values for R, G, B and a start/end palette range to modify.
 		// Now, how on earth does on modify the saturation of a single color channel?
 		// Change the hue/saturation of a color, no problem, I know how to do that,
 		// but for only a channel alone, I don't even know what that should mean... :-/
+//		warning("o8_roomOps: SO_ROOM_SATURATION(%d, %d, %d, %d, %d)", a, b, c, d, e);
 		break;
 	default:
 		error("o8_roomOps: default case %d", subOp);





More information about the Scummvm-git-logs mailing list