From fe8fbf70076a111d41a24423db06cca5c2768a1a Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sun, 20 Nov 2016 16:09:27 -0600 Subject: 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. --- engines/sci/resource.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'engines/sci') 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; -- cgit v1.2.3