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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sat Jul 28 15:56:27 CEST 2007


Revision: 28267
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28267&view=rev
Author:   peres001
Date:     2007-07-28 06:56:27 -0700 (Sat, 28 Jul 2007)

Log Message:
-----------
Fixed bug #1762638. Mask filenames weren't chosen correctly when not explicitly specified by scripts.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/disk_ns.cpp

Modified: scummvm/trunk/engines/parallaction/disk_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_ns.cpp	2007-07-28 13:28:25 UTC (rev 28266)
+++ scummvm/trunk/engines/parallaction/disk_ns.cpp	2007-07-28 13:56:27 UTC (rev 28267)
@@ -1208,13 +1208,16 @@
 }
 
 void AmigaDisk_ns::loadMask(const char *name) {
+	debugC(5, kDebugDisk, "AmigaDisk_ns::loadMask(%s)", name);
 
 	char path[PATH_LEN];
 	sprintf(path, "%s.mask", name);
 
 	Common::SeekableReadStream *s = openArchivedFile(path, false);
-	if (s == NULL)
+	if (s == NULL) {
+		debugC(5, kDebugDisk, "Mask file not found");
 		return;	// no errors if missing mask files: not every location has one
+	}
 
 	s->seek(0x30, SEEK_SET);
 
@@ -1236,6 +1239,12 @@
 	byte *buf = (byte*)malloc(_vm->_screenMaskSize);
 	stream.read(buf, _vm->_screenMaskSize);
 	buildMask(buf);
+
+	FILE *f = fopen("mask.bin", "wb");
+	fwrite(buf, _vm->_screenMaskSize, 1, f);
+	fclose(f);
+	printf("written\n");
+
 	_vm->_gfx->setMask(buf);
 	free(buf);
 	delete s;
@@ -1272,9 +1281,15 @@
 	sprintf(path, "%s.bkgnd", background);
 
 	loadBackground(path);
-	loadMask(background);
-	loadPath(background);
 
+	if (mask == NULL) {
+		loadMask(background);
+		loadPath(background);
+	} else {
+		loadMask(mask);
+		loadPath(mask);
+	}
+
 	return;
 }
 


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