[Scummvm-cvs-logs] SF.net SVN: scummvm: [21839] scummvm/trunk/engines/cine/gfx.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Thu Apr 13 02:55:02 CEST 2006


Revision: 21839
Author:   eriktorbjorn
Date:     2006-04-13 02:53:51 -0700 (Thu, 13 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21839&view=rev

Log Message:
-----------
Work around crash in drawSpriteRaw(). In Future Wars, when going to the future,
I walked back to the room where I first arrived. At that point, maskPtr was
NULL for reasons yet unknown.

Modified Paths:
--------------
    scummvm/trunk/engines/cine/gfx.cpp
Modified: scummvm/trunk/engines/cine/gfx.cpp
===================================================================
--- scummvm/trunk/engines/cine/gfx.cpp	2006-04-13 09:45:03 UTC (rev 21838)
+++ scummvm/trunk/engines/cine/gfx.cpp	2006-04-13 09:53:51 UTC (rev 21839)
@@ -324,12 +324,16 @@
 	int16 i;
 	int16 j;
 
+	// FIXME: Is it a bug if maskPtr == NULL?
+	if (!maskPtr)
+		warning("drawSpriteRaw: maskPtr == NULL");
+
 	for (i = 0; i < height; i++) {
 		byte *destPtr = page + x + y * 320;
 		destPtr += i * 320;
 
 		for (j = 0; j < width * 8; j++) {
-			if (((gameType == Cine::GID_FW && !(*maskPtr)) || (gameType == Cine::GID_OS)) && (x + j >= 0
+			if (((gameType == Cine::GID_FW && (!maskPtr || !(*maskPtr))) || (gameType == Cine::GID_OS)) && (x + j >= 0
 					&& x + j < 320 && i + y >= 0 && i + y < 200)) {
 				*(destPtr++) = *(spritePtr++);
 			} else {
@@ -337,7 +341,8 @@
 				spritePtr++;
 			}
 
-			maskPtr++;
+			if (maskPtr)
+				maskPtr++;
 		}
 	}
 }


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