diff options
author | Paul Gilbert | 2015-05-17 11:50:39 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-05-17 11:50:39 -0400 |
commit | 7cd4d1561032104657544d3deda9aada5c06da45 (patch) | |
tree | 482f7f616cb259582a7184ad6483210c4d438e10 /engines/sherlock/scene.cpp | |
parent | 4af7b58e94bfa505900d363d0bb5c31a0e1f7278 (diff) | |
download | scummvm-rg350-7cd4d1561032104657544d3deda9aada5c06da45.tar.gz scummvm-rg350-7cd4d1561032104657544d3deda9aada5c06da45.tar.bz2 scummvm-rg350-7cd4d1561032104657544d3deda9aada5c06da45.zip |
SHERLOCK: Fix scene loading when using a Small installation
Diffstat (limited to 'engines/sherlock/scene.cpp')
-rw-r--r-- | engines/sherlock/scene.cpp | 58 |
1 files changed, 42 insertions, 16 deletions
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp index 619c253bed..3dcfddd428 100644 --- a/engines/sherlock/scene.cpp +++ b/engines/sherlock/scene.cpp @@ -272,26 +272,52 @@ bool Scene::loadScene(const Common::String &filename) { bgInfo[idx].load(*rrmStream); // Read information - Common::SeekableReadStream *infoStream = !_lzwMode ? rrmStream : - Resources::decompressLZ(*rrmStream, bgHeader._numStructs * 569 + - bgHeader._descSize + bgHeader._seqSize); - - _bgShapes.resize(bgHeader._numStructs); - for (int idx = 0; idx < bgHeader._numStructs; ++idx) - _bgShapes[idx].load(*infoStream); + if (!_lzwMode) { + _bgShapes.resize(bgHeader._numStructs); + for (int idx = 0; idx < bgHeader._numStructs; ++idx) + _bgShapes[idx].load(*rrmStream); + + if (bgHeader._descSize) { + _descText.resize(bgHeader._descSize); + rrmStream->read(&_descText[0], bgHeader._descSize); + } - if (bgHeader._descSize) { - _descText.resize(bgHeader._descSize); - infoStream->read(&_descText[0], bgHeader._descSize); - } + if (bgHeader._seqSize) { + _sequenceBuffer.resize(bgHeader._seqSize); + rrmStream->read(&_sequenceBuffer[0], bgHeader._seqSize); + } + } else { + Common::SeekableReadStream *infoStream; + + // Read shapes + infoStream = Resources::decompressLZ(*rrmStream, bgHeader._numStructs * 569); - if (bgHeader._seqSize) { - _sequenceBuffer.resize(bgHeader._seqSize); - infoStream->read(&_sequenceBuffer[0], bgHeader._seqSize); - } + _bgShapes.resize(bgHeader._numStructs); + for (int idx = 0; idx < bgHeader._numStructs; ++idx) + _bgShapes[idx].load(*infoStream); - if (_lzwMode) delete infoStream; + + // Read description texts + if (bgHeader._descSize) { + infoStream = Resources::decompressLZ(*rrmStream, bgHeader._descSize); + + _descText.resize(bgHeader._descSize); + infoStream->read(&_descText[0], bgHeader._descSize); + + delete infoStream; + } + + // Read sequences + if (bgHeader._seqSize) { + infoStream = Resources::decompressLZ(*rrmStream, bgHeader._seqSize); + + _sequenceBuffer.resize(bgHeader._seqSize); + infoStream->read(&_sequenceBuffer[0], bgHeader._seqSize); + + delete infoStream; + } + } // Set up the list of images used by the scene _images.resize(bgHeader._numImages + 1); |