[Scummvm-cvs-logs] CVS: scummvm/scumm nut_renderer.cpp,1.42,1.43

Eugene Sandulenko sev at users.sourceforge.net
Mon Feb 2 14:43:01 CET 2004


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

Modified Files:
	nut_renderer.cpp 
Log Message:
Fixed most bugs, so only cosmetic visual things left.

o Support transparency for characters. Needed for cockpit rendering
o Fixed bug in NUT renderer which drawed transparent characters garbled 
o Fixed long-standing (and outstanding) bug with SAUD error
o Previous fix fixed music in some cases (scene transitions)
o Fixed bug with palette being reset when smush video is rewind
o Made debug level for insane adjustable at compile time (maybe I will remove it later)


Index: nut_renderer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/nut_renderer.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- nut_renderer.cpp	1 Feb 2004 21:08:46 -0000	1.42
+++ nut_renderer.cpp	2 Feb 2004 22:40:19 -0000	1.43
@@ -159,6 +159,10 @@
 				_chars[l].width = READ_LE_UINT16(dataSrc + offset + 14);
 				_chars[l].height = READ_LE_UINT16(dataSrc + offset + 16);
 				_chars[l].src = new byte[(_chars[l].width + 2) * _chars[l].height + 1000];
+				// If characters have transparency, then bytes just get skipped and
+				// so there may appear some garbage. That's why we have to fill it
+				// with zeroes first.
+				memset(_chars[l].src, 0, (_chars[l].width + 2) * _chars[l].height + 1000);
 				if ((codec == 44) || (codec == 21)) 
 					decoded_length = decodeCodec44(_chars[l].src, dataSrc + offset + 22, READ_BE_UINT32(dataSrc + offset + 4) - 14);
 				else if (codec == 1) {
@@ -304,7 +308,7 @@
 	for (int ty = minY; ty < height; ty++) {
 		for (int tx = minX; tx < width; tx++) {
 			bits = src[tx];
-			if (bits != 231) {
+			if (bits != 231 && bits) {
 				dst[tx] = bits;
 			}
 		}





More information about the Scummvm-git-logs mailing list