aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Snover2016-11-20 16:09:27 -0600
committerColin Snover2016-11-20 16:16:17 -0600
commitfe8fbf70076a111d41a24423db06cca5c2768a1a (patch)
tree869c79b62e60d7177c24ff3bf4995748ef87be18
parente49cf11275a1dffdb6b6573d2637e60f1e280cac (diff)
downloadscummvm-rg350-fe8fbf70076a111d41a24423db06cca5c2768a1a.tar.gz
scummvm-rg350-fe8fbf70076a111d41a24423db06cca5c2768a1a.tar.bz2
scummvm-rg350-fe8fbf70076a111d41a24423db06cca5c2768a1a.zip
SCI32: Fix reading view, pic, and palette patches
Unlike SCI16 games, the location of data within SCI32 patch files is calculated on a per-resource-type basis by the game engine, instead of by reading byte 1 of the patch file.
-rw-r--r--engines/sci/resource.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 5b57eed123..31ceb6808c 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -1399,7 +1399,20 @@ void ResourceManager::processPatch(ResourceSource *source, ResourceType resource
}
byte patchType = convertResType(fileStream->readByte());
- byte patchDataOffset = fileStream->readByte();
+ int32 patchDataOffset;
+ if (_volVersion < kResVersionSci2) {
+ patchDataOffset = fileStream->readByte();
+ } else if (patchType == kResourceTypeView) {
+ fileStream->seek(3, SEEK_SET);
+ patchDataOffset = fileStream->readByte() + 22 + 2;
+ } else if (patchType == kResourceTypePic) {
+ patchDataOffset = 2;
+ } else if (patchType == kResourceTypePalette) {
+ fileStream->seek(3, SEEK_SET);
+ patchDataOffset = fileStream->readByte() + 2;
+ } else {
+ patchDataOffset = 0;
+ }
delete fileStream;