[Scummvm-cvs-logs] SF.net SVN: scummvm: [31593] scummvm/trunk/engines/kyra/screen.cpp

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Apr 20 13:52:08 CEST 2008


Revision: 31593
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31593&view=rev
Author:   lordhoto
Date:     2008-04-20 04:52:08 -0700 (Sun, 20 Apr 2008)

Log Message:
-----------
Fixed long standing bug in encodeShape.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/screen.cpp

Modified: scummvm/trunk/engines/kyra/screen.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen.cpp	2008-04-20 10:57:50 UTC (rev 31592)
+++ scummvm/trunk/engines/kyra/screen.cpp	2008-04-20 11:52:08 UTC (rev 31593)
@@ -2300,7 +2300,7 @@
 					to = curToPtr;
 					*to++ = 0xFE;
 					WRITE_LE_UINT16(to, diffSize); to += 2;
-					*to++ = (size >> 8) & 0xFF;
+					*to++ = curPixel;
 					curToPtr = to;
 					to = toBackUp;
 					continue;
@@ -2319,9 +2319,9 @@
 					if (*to++ == curPixel)
 						break;
 				}
-				if (*to == curPixel) {
-					if (*(from+size-1) == *(to+size-2))
-						break;
+				if (*(to-1) == curPixel) {
+					if (*(from+size-1) != *(to+size-2))
+						continue;
 
 					byte *fromBackUp = from;
 					byte *toBackUp = to;
@@ -2355,7 +2355,7 @@
 			uint16 word = 0;
 			if (size <= 0x0A) {
 				uint16 diffSize = from - tempPtr;
-				if (size <= 0x0FFF) {
+				if (diffSize <= 0x0FFF) {
 					byte highByte = ((diffSize & 0xFF00) >> 8) + (((size & 0xFF) - 3) << 4);
 					word = ((diffSize & 0xFF) << 8) | highByte;
 					WRITE_LE_UINT16(to, word); to += 2;


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