diff options
author | Dmitry Iskrich | 2016-06-29 20:38:17 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 30db02c87ebe64a0cad3dd5d5d4454f73df55466 (patch) | |
tree | 15895be8cd8ccd603d0aa290df27be3433406f86 /engines/director/score.cpp | |
parent | b208b8e5fffc6a13277987d98400488c4d59d9c1 (diff) | |
download | scummvm-rg350-30db02c87ebe64a0cad3dd5d5d4454f73df55466.tar.gz scummvm-rg350-30db02c87ebe64a0cad3dd5d5d4454f73df55466.tar.bz2 scummvm-rg350-30db02c87ebe64a0cad3dd5d5d4454f73df55466.zip |
DIRECTOR: Handle some differences beetwen D1-3 and D4-6
Diffstat (limited to 'engines/director/score.cpp')
-rw-r--r-- | engines/director/score.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 59b37ececf..2778cecec2 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -74,10 +74,14 @@ void Score::loadArchive() { assert(_movieArchive->hasResource(MKTAG('V','W','S','C'), 1024)); assert(_movieArchive->hasResource(MKTAG('V','W','C','F'), 1024)); - assert(_movieArchive->hasResource(MKTAG('V','W','C','R'), 1024)); + loadFrames(*_movieArchive->getResource(MKTAG('V','W','S','C'), 1024)); loadConfig(*_movieArchive->getResource(MKTAG('V','W','C','F'), 1024)); - loadCastData(*_movieArchive->getResource(MKTAG('V','W','C','R'), 1024)); + + if (_vm->getVersion() < 4) { + assert(_movieArchive->hasResource(MKTAG('V','W','C','R'), 1024)); + loadCastData(*_movieArchive->getResource(MKTAG('V','W','C','R'), 1024)); + } if (_movieArchive->hasResource(MKTAG('V','W','A','C'), 1024)) { loadActions(*_movieArchive->getResource(MKTAG('V','W','A','C'), 1024)); @@ -145,6 +149,12 @@ void Score::loadPalette(Common::SeekableSubReadStreamEndian &stream) { void Score::loadFrames(Common::SeekableSubReadStreamEndian &stream) { uint32 size = stream.readUint32(); size -= 4; + + if (_vm->getVersion() > 3) { + stream.skip(16); + //Unknown, some bytes - constant (refer to contuinity). + } + uint16 channelSize; uint16 channelOffset; @@ -158,10 +168,17 @@ void Score::loadFrames(Common::SeekableSubReadStreamEndian &stream) { Frame *frame = new Frame(*_frames.back()); while (frameSize != 0) { - channelSize = stream.readByte() * 2; - channelOffset = stream.readByte() * 2; + if (_vm->getVersion() < 4) { + channelSize = stream.readByte() * 2; + channelOffset = stream.readByte() * 2; + frameSize -= channelSize + 2; + } else { + channelSize = stream.readByte(); + channelOffset = stream.readByte(); + frameSize -= channelSize + 4; + } frame->readChannel(stream, channelOffset, channelSize); - frameSize -= channelSize + 2; + } _frames.push_back(frame); |