diff options
author | Nicola Mettifogo | 2007-07-28 13:56:27 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-07-28 13:56:27 +0000 |
commit | 7059a69bde6c2a465c41062142524c9f521c49e8 (patch) | |
tree | 399b71a5495eb7b0b5ab0d49a4ab1c4a862a5e40 /engines/parallaction/disk_ns.cpp | |
parent | 2c40b302abfa36cc0fc04b3911186be919c01129 (diff) | |
download | scummvm-rg350-7059a69bde6c2a465c41062142524c9f521c49e8.tar.gz scummvm-rg350-7059a69bde6c2a465c41062142524c9f521c49e8.tar.bz2 scummvm-rg350-7059a69bde6c2a465c41062142524c9f521c49e8.zip |
Fixed bug #1762638. Mask filenames weren't chosen correctly when not explicitly specified by scripts.
svn-id: r28267
Diffstat (limited to 'engines/parallaction/disk_ns.cpp')
-rw-r--r-- | engines/parallaction/disk_ns.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp index e500cd519b..882488056f 100644 --- a/engines/parallaction/disk_ns.cpp +++ b/engines/parallaction/disk_ns.cpp @@ -1208,13 +1208,16 @@ void AmigaDisk_ns::loadBackground(const char *name) { } 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 @@ void AmigaDisk_ns::loadMask(const char *name) { 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,8 +1281,14 @@ void AmigaDisk_ns::loadScenery(const char* background, const char* mask) { sprintf(path, "%s.bkgnd", background); loadBackground(path); - loadMask(background); - loadPath(background); + + if (mask == NULL) { + loadMask(background); + loadPath(background); + } else { + loadMask(mask); + loadPath(mask); + } return; } |