[Scummvm-cvs-logs] SF.net SVN: scummvm:[39418] scummvm/trunk/engines/parallaction

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Sun Mar 15 14:28:20 CET 2009


Revision: 39418
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39418&view=rev
Author:   Kirben
Date:     2009-03-15 13:28:20 +0000 (Sun, 15 Mar 2009)

Log Message:
-----------
Fix crash regression in the Amiga BRA demo, by checking if mask buffer exists, before using it.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/disk_br.cpp
    scummvm/trunk/engines/parallaction/gfxbase.cpp

Modified: scummvm/trunk/engines/parallaction/disk_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_br.cpp	2009-03-15 11:36:16 UTC (rev 39417)
+++ scummvm/trunk/engines/parallaction/disk_br.cpp	2009-03-15 13:28:20 UTC (rev 39418)
@@ -481,14 +481,14 @@
 	}
 #if 0
 	if (mask) {
-		stream = tryOpenFile("msk/" + Common::String(path), ".msk");
+		stream = tryOpenFile("msk/" + Common::String(mask), ".msk");
 		if (stream) {
 			Graphics::PackBitsReadStream unpackedStream(*stream);
 			info._mask = new MaskBuffer;
+			info._path->bigEndian = false;
 			info._mask->create(info.width, info.height);
 			unpackedStream.read(info._mask->data, info._mask->size);
 			// TODO: there is another step to do after decompression...
-			loadMask(mask, *info._mask);
 			delete stream;
 		} else {
 			debugC(1, kDebugDisk, "AmigaDisk_br::loadScenery: (%s) not found", mask);

Modified: scummvm/trunk/engines/parallaction/gfxbase.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/gfxbase.cpp	2009-03-15 11:36:16 UTC (rev 39417)
+++ scummvm/trunk/engines/parallaction/gfxbase.cpp	2009-03-15 13:28:20 UTC (rev 39418)
@@ -349,8 +349,12 @@
 			}
 
 			if (*s != transparentColor) {
-				byte v = _backgroundInfo->_mask->getValue(dp.x + col, dp.y + line);
-				if (z >= v) *d2 = *s;
+				if (_backgroundInfo->hasMask()) {
+					byte v = _backgroundInfo->_mask->getValue(dp.x + col, dp.y + line);
+					if (z >= v) *d2 = *s;
+				} else {
+					*d2 = *s;
+				}
 			}
 
 			s++;
@@ -395,8 +399,12 @@
 
 		for (uint16 j = 0; j < q.width(); j++) {
 			if (*s != transparentColor) {
-				byte v = _backgroundInfo->_mask->getValue(dp.x + j, dp.y + i);
-				if (z >= v) *d = *s;
+				if (_backgroundInfo->hasMask()) {
+					byte v = _backgroundInfo->_mask->getValue(dp.x + j, dp.y + i);
+					if (z >= v) *d = *s;
+				} else {
+					*d = *s;
+				}
 			}
 
 			s++;


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