aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorColin Snover2017-05-13 22:45:20 -0500
committerColin Snover2017-05-13 22:49:40 -0500
commitb1ace1a01c15f4964cc91df7fead81e362e24424 (patch)
treeffff2469c6b543d8ccb7f5376cd4601643db53a1 /engines/sci
parentf44d8b6da69a1444c76fcbce28a834f2368ddf35 (diff)
downloadscummvm-rg350-b1ace1a01c15f4964cc91df7fead81e362e24424.tar.gz
scummvm-rg350-b1ace1a01c15f4964cc91df7fead81e362e24424.tar.bz2
scummvm-rg350-b1ace1a01c15f4964cc91df7fead81e362e24424.zip
SCI: Suppress resource warnings when running fallback detection
For the moment, only warn about bad resources when a game is actually starting, since unknown but valid resources being detected by the fallback detector currently also trigger the warning.
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/detection.cpp2
-rw-r--r--engines/sci/resource.cpp6
-rw-r--r--engines/sci/resource.h4
3 files changed, 7 insertions, 5 deletions
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index cc6bb000b6..93157b04c1 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -612,7 +612,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles,
if (!foundResMap && !foundRes000)
return 0;
- ResourceManager resMan;
+ ResourceManager resMan(true);
resMan.addAppropriateSourcesForDetection(fslist);
resMan.init();
// TODO: Add error handling.
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index f1b2a58577..068be662a4 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -809,7 +809,7 @@ void ResourceManager::scanNewSources() {
// (e.g. KQ5 via kDoAudio, MGDX via kSetLanguage), and users really should
// be warned of bad resources in this situation (KQ Collection 1997 has a
// bad copy of KQ5 on CD 1; the working copy is on CD 2)
- if (_hasBadResources) {
+ if (!_detectionMode && _hasBadResources) {
showScummVMDialog(_("Missing or corrupt game resources have been detected. "
"Some game features may not work properly. Please check "
"the console for more information, and verify that your "
@@ -950,8 +950,8 @@ void ResourceManager::freeResourceSources() {
_sources.clear();
}
-ResourceManager::ResourceManager() {
-}
+ResourceManager::ResourceManager(const bool detectionMode) :
+ _detectionMode(detectionMode) {}
void ResourceManager::init() {
_maxMemoryLRU = 256 * 1024; // 256KiB
diff --git a/engines/sci/resource.h b/engines/sci/resource.h
index 1a10fb2ccd..3239a16081 100644
--- a/engines/sci/resource.h
+++ b/engines/sci/resource.h
@@ -319,7 +319,7 @@ public:
/**
* Creates a new SCI resource manager.
*/
- ResourceManager();
+ ResourceManager(const bool detectionMode = false);
~ResourceManager();
@@ -454,6 +454,8 @@ public:
ResourceType convertResType(byte type);
protected:
+ bool _detectionMode;
+
// Maximum number of bytes to allow being allocated for resources
// Note: maxMemory will not be interpreted as a hard limit, only as a restriction
// for resources which are not explicitly locked. However, a warning will be