aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Snover2017-04-23 22:03:10 -0500
committerColin Snover2017-04-23 22:11:05 -0500
commit82d9cacba0e7c2c6f5b0ce4d07f8f44a2044488f (patch)
tree162762e45a4e608100afe68940485af42a64f156
parente0539dd0e51569fe01fd64a03bb642cd4170436e (diff)
downloadscummvm-rg350-82d9cacba0e7c2c6f5b0ce4d07f8f44a2044488f.tar.gz
scummvm-rg350-82d9cacba0e7c2c6f5b0ce4d07f8f44a2044488f.tar.bz2
scummvm-rg350-82d9cacba0e7c2c6f5b0ce4d07f8f44a2044488f.zip
SCI32: Allow resource maps with missing corresponding volumes
GK2 on Steam comes with an extra bogus resource map file which would previously cause ScummVM to refuse to load the game due to a mismatch in the number of map & volume files. This does not cause any harm, but is a pain for users (since it requires them to manually delete the file, and it will be recreated if a user runs the Steam game file integrity check), so allow the game to load with a warning instead.
-rw-r--r--engines/sci/resource.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index f5edda9eb0..92b90d00ea 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -615,8 +615,7 @@ int ResourceManager::addAppropriateSources() {
SearchMan.listMatchingMembers(mapFiles, "resmap.0??");
SearchMan.listMatchingMembers(files, "ressci.0??");
- // We need to have the same number of maps as resource archives
- if (mapFiles.empty() || files.empty() || mapFiles.size() != files.size())
+ if (mapFiles.empty() || files.empty())
return 0;
if (Common::File::exists("resaud.001")) {
@@ -626,16 +625,23 @@ int ResourceManager::addAppropriateSources() {
for (Common::ArchiveMemberList::const_iterator mapIterator = mapFiles.begin(); mapIterator != mapFiles.end(); ++mapIterator) {
Common::String mapName = (*mapIterator)->getName();
int mapNumber = atoi(strrchr(mapName.c_str(), '.') + 1);
+ bool foundVolume = false;
for (Common::ArchiveMemberList::const_iterator fileIterator = files.begin(); fileIterator != files.end(); ++fileIterator) {
Common::String resName = (*fileIterator)->getName();
int resNumber = atoi(strrchr(resName.c_str(), '.') + 1);
if (mapNumber == resNumber) {
+ foundVolume = true;
addSource(new VolumeResourceSource(resName, addExternalMap(mapName, mapNumber), mapNumber));
break;
}
}
+
+ // GK2 on Steam comes with an extra bogus resource map file
+ if (!foundVolume) {
+ warning("Could not find corresponding volume for %s", mapName.c_str());
+ }
}
// SCI2.1 resource patches