diff options
author | Colin Snover | 2017-05-08 23:25:37 -0500 |
---|---|---|
committer | Colin Snover | 2017-05-08 23:59:28 -0500 |
commit | eb6e1791690c2498891071ecc944bb381b413732 (patch) | |
tree | c6db0d2b1d13d38ea5653d837046b6cc976ba99a /engines | |
parent | ae628c18d462f4b58a6636f9fd4655e98072b5a1 (diff) | |
download | scummvm-rg350-eb6e1791690c2498891071ecc944bb381b413732.tar.gz scummvm-rg350-eb6e1791690c2498891071ecc944bb381b413732.tar.bz2 scummvm-rg350-eb6e1791690c2498891071ecc944bb381b413732.zip |
SCI: Fix SCI1.1 patch resources
While earlier commits had fixed handling of audio resources in
audio bundles to match SSCI, audio *patches* in SCI16 were still
being treated like standard resource patches. They are now
special-cased in the resource manager, just like SCI32.
Incidentally, while fixing the problem with audio patches, I also
noticed that the patch resource fixes for SQ5/German were very
similar to the special-case operations for resources in SCI32,
though using an odd heuristic. After investigating, it appears
that Sierra SCI1.1 works mostly like SCI32, and not like what
was there from SCI View. So, the old special-case code is deleted
and the special-case code for SCI32 has been expanded to cover
SCI1.1. (SSCI prior to 1.1 do not appear to do this
special-casing.)
Fixes Trac#9773.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/resource.cpp | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 089b466729..ccf576d51d 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -1465,18 +1465,21 @@ void ResourceManager::processPatch(ResourceSource *source, ResourceType resource }; int32 patchDataOffset = kResourceHeaderSize; - if (_volVersion < kResVersionSci2) { + if (_volVersion < kResVersionSci11) { patchDataOffset += fileStream->readByte(); - } -#ifdef ENABLE_SCI32 - else { + } else { switch (patchType) { case kResourceTypeView: fileStream->seek(3, SEEK_SET); patchDataOffset += fileStream->readByte() + kViewHeaderSize + kExtraHeaderSize; break; case kResourceTypePic: - patchDataOffset += kExtraHeaderSize; + if (_volVersion < kResVersionSci2) { + fileStream->seek(3, SEEK_SET); + patchDataOffset += fileStream->readByte() + kViewHeaderSize + kExtraHeaderSize; + } else { + patchDataOffset += kExtraHeaderSize; + } break; case kResourceTypePalette: fileStream->seek(3, SEEK_SET); @@ -1499,7 +1502,6 @@ void ResourceManager::processPatch(ResourceSource *source, ResourceType resource break; } } -#endif delete fileStream; @@ -1509,24 +1511,6 @@ void ResourceManager::processPatch(ResourceSource *source, ResourceType resource return; } - // Fixes SQ5/German, patch file special case logic taken from SCI View disassembly - if (patchDataOffset & 0x80) { - switch ((patchDataOffset - kResourceHeaderSize) & 0x7F) { - case 0: - patchDataOffset = kResourceHeaderSize + 24; - break; - case 1: - patchDataOffset = kResourceHeaderSize + 2; - break; - case 4: - patchDataOffset = kResourceHeaderSize + 8; - break; - default: - error("Resource patch unsupported special case %X", patchDataOffset & 0x7F); - return; - } - } - if (patchDataOffset >= fsize) { debug("Patching %s failed - patch starting at offset %d can't be in file of size %d", source->getLocationName().c_str(), patchDataOffset, fsize); |