diff options
author | Matthew Hoops | 2015-03-08 15:34:48 -0400 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | de61313e949ad2fe8eb076493fd4990f54a69555 (patch) | |
tree | 13f4925e0801c599a698d0cbb24e92d6df0ae585 /engines/director/director.cpp | |
parent | a9849314e8c6b78029f9ecaab0bce1016d232dd6 (diff) | |
download | scummvm-rg350-de61313e949ad2fe8eb076493fd4990f54a69555.tar.gz scummvm-rg350-de61313e949ad2fe8eb076493fd4990f54a69555.tar.bz2 scummvm-rg350-de61313e949ad2fe8eb076493fd4990f54a69555.zip |
DIRECTOR: Fix RIFX support to actually be useful
Diffstat (limited to 'engines/director/director.cpp')
-rw-r--r-- | engines/director/director.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp index 2664497984..1ae6f54713 100644 --- a/engines/director/director.cpp +++ b/engines/director/director.cpp @@ -163,11 +163,9 @@ void DirectorEngine::loadEXEv7(Common::SeekableReadStream *stream) { } void DirectorEngine::loadEXERIFX(Common::SeekableReadStream *stream, uint32 offset) { - stream->seek(offset); - _mainArchive = new RIFXArchive(); - if (!_mainArchive->openStream(stream)) + if (!_mainArchive->openStream(stream, offset)) error("Failed to load RIFX from EXE"); } @@ -191,16 +189,17 @@ void DirectorEngine::loadMac() { // First we need to detect PPC vs. 68k uint32 tag = dataFork->readUint32BE(); + uint32 startOffset; if (SWAP_BYTES_32(tag) == MKTAG('P', 'J', '9', '3') || tag == MKTAG('P', 'J', '9', '5') || tag == MKTAG('P', 'J', '0', '0')) { // PPC: The RIFX shares the data fork with the binary - dataFork->seek(dataFork->readUint32BE()); + startOffset = dataFork->readUint32BE(); } else { // 68k: The RIFX is the only thing in the data fork - dataFork->seek(0); + startOffset = 0; } - if (!_mainArchive->openStream(dataFork)) + if (!_mainArchive->openStream(dataFork, startOffset)) error("Failed to load RIFX from Mac binary"); } } |