[Scummvm-cvs-logs] SF.net SVN: scummvm:[49743] scummvm/trunk/engines/agi

sev at users.sourceforge.net sev at users.sourceforge.net
Tue Jun 15 12:31:39 CEST 2010


Revision: 49743
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49743&view=rev
Author:   sev
Date:     2010-06-15 10:31:39 +0000 (Tue, 15 Jun 2010)

Log Message:
-----------
AGI: Fix bug #2825278.

Bug #2825278: "AGI: KQ4: Swimming on land". Our drawing code was
not picture perfect, and thus priority screen was trashed by one
of Fills, i.e. the color leaked and took whole screen.

Modified Paths:
--------------
    scummvm/trunk/engines/agi/loader_v3.cpp
    scummvm/trunk/engines/agi/picture.cpp

Modified: scummvm/trunk/engines/agi/loader_v3.cpp
===================================================================
--- scummvm/trunk/engines/agi/loader_v3.cpp	2010-06-15 10:31:18 UTC (rev 49742)
+++ scummvm/trunk/engines/agi/loader_v3.cpp	2010-06-15 10:31:39 UTC (rev 49743)
@@ -227,19 +227,12 @@
 		compBuffer = (uint8 *)calloc(1, agid->clen + 32);
 		fp.read(compBuffer, agid->clen);
 
-		if (x[2] & 0x80 || agid->len == agid->clen) {
+		if (x[2] & 0x80) { // compressed pic
+			data = _vm->_picture->convertV3Pic(compBuffer, agid->clen);
+			free(compBuffer);
+		} else if (agid->len == agid->clen) {
 			// do not decompress
 			data = compBuffer;
-
-#if 0
-			// CM: added to avoid problems in
-			//     convert_v2_v3_pic() when clen > len
-			//     e.g. Sierra demo 4, first picture
-			//     (Tue Mar 16 13:13:43 EST 1999)
-			agid->len = agid->clen;
-
-			// Now removed to fix Gold Rush! in demo4
-#endif
 		} else {
 			// it is compressed
 			data = (uint8 *)calloc(1, agid->len + 32);
@@ -309,7 +302,6 @@
 			unloadResource(rPICTURE, n);
 			data = loadVolRes(&_vm->_game.dirPic[n]);
 			if (data != NULL) {
-				data = _vm->_picture->convertV3Pic(data, _vm->_game.dirPic[n].len);
 				_vm->_game.pictures[n].rdata = data;
 				_vm->_game.dirPic[n].flags |= RES_LOADED;
 			} else {

Modified: scummvm/trunk/engines/agi/picture.cpp
===================================================================
--- scummvm/trunk/engines/agi/picture.cpp	2010-06-15 10:31:18 UTC (rev 49742)
+++ scummvm/trunk/engines/agi/picture.cpp	2010-06-15 10:31:39 UTC (rev 49743)
@@ -476,7 +476,7 @@
 
 	// new purpose for temp16
 
-	temp16 =( pen_size<<1) +1;	// pen size
+	temp16 = (pen_size << 1) + 1;	// pen size
 	pen_final_y += temp16;					// the last row of this shape
 	temp16 = temp16 << 1;
 	pen_width = temp16;					// width of shape?
@@ -495,7 +495,7 @@
 	} else {
 		circleCond = ((_patCode & 0x10) != 0);
 		counterStep = 4;
-		ditherCond = 0x02;
+		ditherCond = 0x01;
 	}
 
 	for (; pen_y < pen_final_y; pen_y++) {
@@ -503,10 +503,12 @@
 
 		for (counter = 0; counter <= pen_width; counter += counterStep) {
 			if (circleCond || ((binary_list[counter>>1] & circle_word) != 0)) {
-				temp8 = t % 2;
-				t = t >> 1;
-				if (temp8 != 0)
-					t = t ^ 0xB8;
+				if ((_patCode & 0x20) != 0) {
+					temp8 = t % 2;
+					t = t >> 1;
+					if (temp8 != 0)
+						t = t ^ 0xB8;
+				}
 
 				// == box plot, != circle plot
 				if ((_patCode & 0x20) == 0 || (t & 0x03) == ditherCond)


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