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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Tue Jan 9 12:50:25 CET 2007


Revision: 25059
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25059&view=rev
Author:   lordhoto
Date:     2007-01-09 03:50:22 -0800 (Tue, 09 Jan 2007)

Log Message:
-----------
Fix for bug #1631352 ("KYRA1: Graphics heavily broken and ScummVM crash"), I tried memmove here, but it also crashed on Win32 with memmove, so I reverted it back to how it was.

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

Modified: scummvm/trunk/engines/kyra/screen.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen.cpp	2007-01-09 00:33:23 UTC (rev 25058)
+++ scummvm/trunk/engines/kyra/screen.cpp	2007-01-09 11:50:22 UTC (rev 25059)
@@ -1414,7 +1414,9 @@
 			int len = MIN(count, (code >> 4) + 3); //upper half of code is the length		
 			int offs = ((code & 0xF) << 8) | *src++; //lower half of code as byte 2 of offset.
 			const uint8 *dstOffs = dst - offs;
-			memcpy(dst, dstOffs, len); dst += len;
+			while (len--) {
+				*dst++ = *dstOffs++;
+			}
 		} else if (code & 0x40) { // 7th bit is set
 			int len = (code & 0x3F) + 3;
 			if (code == 0xFE) {
@@ -1432,12 +1434,16 @@
 					len = count;
 				}
 				const uint8 *dstOffs = dstOrig + offs;
-				memcpy(dst, dstOffs, len); dst += len;
+				while (len--) {
+					*dst++ = *dstOffs++;
+				}
 			}
 		} else if (code != 0x80) { // not just the 8th bit set.
 			//Copy some bytes from source to dest.
 			int len = MIN(count, code & 0x3F);
-			memcpy(dst, src, len); dst += len; src += len;
+			while (len--) {
+				*dst++ = *src++;
+			}
 		} else {
 			break;
 		}
@@ -1499,7 +1505,7 @@
 
 template<bool noXor>
 void Screen::wrapped_decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch) {
-	debugC(9, kDebugLevelScreen, "Screen::decodeFrameDeltaPage(%p, %p, %d)", (const void *)dst, (const void *)src, pitch);
+	debugC(9, kDebugLevelScreen, "Screen::wrapped_decodeFrameDeltaPage(%p, %p, %d)", (const void *)dst, (const void *)src, pitch);
 	int count = 0;
 	uint8 *dstNext = dst;
 	while (1) {


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