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.
This commit is contained in:
Colin Snover 2017-05-13 22:45:20 -05:00
parent f44d8b6da6
commit b1ace1a01c
3 changed files with 7 additions and 5 deletions

View file

@ -612,7 +612,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const FileMap &allFiles,
if (!foundResMap && !foundRes000) if (!foundResMap && !foundRes000)
return 0; return 0;
ResourceManager resMan; ResourceManager resMan(true);
resMan.addAppropriateSourcesForDetection(fslist); resMan.addAppropriateSourcesForDetection(fslist);
resMan.init(); resMan.init();
// TODO: Add error handling. // TODO: Add error handling.

View file

@ -809,7 +809,7 @@ void ResourceManager::scanNewSources() {
// (e.g. KQ5 via kDoAudio, MGDX via kSetLanguage), and users really should // (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 // 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) // 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. " showScummVMDialog(_("Missing or corrupt game resources have been detected. "
"Some game features may not work properly. Please check " "Some game features may not work properly. Please check "
"the console for more information, and verify that your " "the console for more information, and verify that your "
@ -950,8 +950,8 @@ void ResourceManager::freeResourceSources() {
_sources.clear(); _sources.clear();
} }
ResourceManager::ResourceManager() { ResourceManager::ResourceManager(const bool detectionMode) :
} _detectionMode(detectionMode) {}
void ResourceManager::init() { void ResourceManager::init() {
_maxMemoryLRU = 256 * 1024; // 256KiB _maxMemoryLRU = 256 * 1024; // 256KiB

View file

@ -319,7 +319,7 @@ public:
/** /**
* Creates a new SCI resource manager. * Creates a new SCI resource manager.
*/ */
ResourceManager(); ResourceManager(const bool detectionMode = false);
~ResourceManager(); ~ResourceManager();
@ -454,6 +454,8 @@ public:
ResourceType convertResType(byte type); ResourceType convertResType(byte type);
protected: protected:
bool _detectionMode;
// Maximum number of bytes to allow being allocated for resources // Maximum number of bytes to allow being allocated for resources
// Note: maxMemory will not be interpreted as a hard limit, only as a restriction // 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 // for resources which are not explicitly locked. However, a warning will be