[Scummvm-cvs-logs] CVS: scummvm/sword1 screen.cpp,1.12,1.13

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Sat Dec 20 05:36:00 CET 2003


Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1:/tmp/cvs-serv18754

Modified Files:
	screen.cpp 
Log Message:
A comment in decompressRLE0() said that the images are vertically flipped,
but I'm not so sure. I've changed the code to assume that they're not, and
this fixes both the drawing of the worker in the background of the first
room, and of the fan at the police station.


Index: screen.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/screen.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- screen.cpp	19 Dec 2003 14:16:31 -0000	1.12
+++ screen.cpp	20 Dec 2003 13:35:00 -0000	1.13
@@ -609,27 +609,26 @@
 }
 
 void SwordScreen::decompressRLE0(uint8 *src, uint32 compSize, uint8 *dest, uint16 width) {
-	// these are saved vertically flipped. *SIIIIIIIGH*
 	uint8 *srcBufEnd = src + compSize;
-	uint16 destX = width-1;
+	uint16 destX = 0;
 	while (src < srcBufEnd) {
 		uint8 color = *src++;
 		if (color) {
 			dest[destX] = color;
-			if (destX == 0) {
-				destX = width-1;
+			if (destX == width-1) {
+				destX = 0;
 				dest += width;
 			} else
-				destX--;
+				destX++;
 		} else {
 			uint8 skip = *src++;
 			for (uint16 cnt = 0; cnt < skip; cnt++) {
 				dest[destX] = 0;
-				if (destX == 0) {
-					destX = width-1;
+				if (destX == width-1) {
+					destX = 0;
 					dest += width;
 				} else
-					destX--;
+					destX++;
 			}
 		}
 	}





More information about the Scummvm-git-logs mailing list