aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorColin Snover2017-07-30 22:59:41 -0500
committerColin Snover2017-08-04 13:29:55 -0500
commit5412bda5abf562760b1dc6c4e2d1aed57ecda27a (patch)
treec0fc78539b88fd06bc81a38b4ce619acfdd43253 /engines
parent5c85230443ad7405a4ebd3167d8a176a2435e991 (diff)
downloadscummvm-rg350-5412bda5abf562760b1dc6c4e2d1aed57ecda27a.tar.gz
scummvm-rg350-5412bda5abf562760b1dc6c4e2d1aed57ecda27a.tar.bz2
scummvm-rg350-5412bda5abf562760b1dc6c4e2d1aed57ecda27a.zip
SCI32: Fix loading audio resources from RESSCI.PAT
This is used by Lighthouse.
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/resource.cpp14
-rw-r--r--engines/sci/resource.h5
2 files changed, 15 insertions, 4 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 019aaffab1..91cdfd2949 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -678,7 +678,7 @@ int ResourceManager::addAppropriateSources() {
// SCI2.1 resource patches
if (Common::File::exists("resmap.pat") && Common::File::exists("ressci.pat")) {
// We add this resource with a map which surely won't exist
- addSource(new VolumeResourceSource("ressci.pat", addExternalMap("resmap.pat", 100), 100));
+ addSource(new VolumeResourceSource("ressci.pat", addExternalMap("resmap.pat", kResPatVolumeNumber), kResPatVolumeNumber));
}
}
#else
@@ -732,7 +732,7 @@ int ResourceManager::addAppropriateSourcesForDetection(const Common::FSList &fsl
#ifdef ENABLE_SCI32
// SCI2.1 resource patches
if (filename.contains("resmap.pat"))
- sci21PatchMap = addExternalMap(file, 100);
+ sci21PatchMap = addExternalMap(file, kResPatVolumeNumber);
if (filename.contains("ressci.pat"))
sci21PatchRes = file;
@@ -744,7 +744,7 @@ int ResourceManager::addAppropriateSourcesForDetection(const Common::FSList &fsl
#ifdef ENABLE_SCI32
if (sci21PatchMap && sci21PatchRes)
- addSource(new VolumeResourceSource(sci21PatchRes->getName(), sci21PatchMap, 100, sci21PatchRes));
+ addSource(new VolumeResourceSource(sci21PatchRes->getName(), sci21PatchMap, kResPatVolumeNumber, sci21PatchRes));
#endif
// Now find all the resource.0?? files
@@ -1913,7 +1913,13 @@ int ResourceManager::readResourceMapSCI1(ResourceSource *map) {
addSource(audioMap);
Common::String volumeName;
- if (resId.getNumber() == 65535) {
+ if (mapVolumeNr == kResPatVolumeNumber) {
+ if (resId.getNumber() == 65535) {
+ volumeName = "RESSCI.PAT";
+ } else {
+ volumeName = "RESAUD.001";
+ }
+ } else if (resId.getNumber() == 65535) {
volumeName = Common::String::format("RESSFX.%03d", mapVolumeNr);
} else {
volumeName = Common::String::format("RESAUD.%03d", mapVolumeNr);
diff --git a/engines/sci/resource.h b/engines/sci/resource.h
index bdf46efc62..830fe997e6 100644
--- a/engines/sci/resource.h
+++ b/engines/sci/resource.h
@@ -43,6 +43,11 @@ class SeekableReadStream;
namespace Sci {
enum {
+#ifdef ENABLE_SCI32
+ // Hack to treat RESMAP.PAT/RESSCI.PAT as the highest volume
+ kResPatVolumeNumber = 100,
+#endif
+
kResourceHeaderSize = 2, ///< patch type + header size
/** The maximum allowed size for a compressed or decompressed resource */