From 5016645345630e485be55d005ba4bb7cd1e4b589 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 14 Jun 2011 18:15:47 +0200 Subject: DETECTOR: Remove kADFlagPrintWarningOnFileBasedFallback --- engines/advancedDetector.cpp | 13 ------------- engines/advancedDetector.h | 8 +++----- engines/touche/detection.cpp | 17 +++++++++++++++-- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp index 82efb0d840..db2f404f5f 100644 --- a/engines/advancedDetector.cpp +++ b/engines/advancedDetector.cpp @@ -511,19 +511,6 @@ const ADGameDescription *AdvancedMetaEngine::detectGameFilebased(const FileMap & } } - if (matchedDesc) { // We got a match - if (_flags & kADFlagPrintWarningOnFileBasedFallback) { - Common::String report = Common::String::format(_("Your game version has been detected using " - "filename matching as a variant of %s."), matchedDesc->gameid); - report += "\n"; - report += _("If this is an original and unmodified version, please report any"); - report += "\n"; - report += _("information previously printed by ScummVM to the team."); - report += "\n"; - g_system->logMessage(LogMessageType::kInfo, report.c_str()); - } - } - return matchedDesc; } diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h index 300ce7bbb5..13fb4b3fb6 100644 --- a/engines/advancedDetector.h +++ b/engines/advancedDetector.h @@ -116,17 +116,15 @@ struct ADFileBasedFallback { enum ADFlags { - /** - * Warn user about new variant if his version was detected with fallback - */ - kADFlagPrintWarningOnFileBasedFallback = (1 << 1), /** * Store value of extra field in config file, and use it as a hint * on subsequent runs. Could be used when there is no way to autodetect * game (when more than one game sits in same directory), and user picks * up a variant manually. + * In addition, this is useful if two variants of a game sharing the same + * gameid are contained in a single directory. */ - kADFlagUseExtraAsHint = (1 << 2) + kADFlagUseExtraAsHint = (1 << 0) }; diff --git a/engines/touche/detection.cpp b/engines/touche/detection.cpp index 723fecec3a..0684144473 100644 --- a/engines/touche/detection.cpp +++ b/engines/touche/detection.cpp @@ -24,6 +24,7 @@ #include "engines/advancedDetector.h" #include "common/savefile.h" #include "common/system.h" +#include "common/translation.h" #include "base/plugins.h" @@ -131,13 +132,25 @@ public: ToucheMetaEngine() : AdvancedMetaEngine(Touche::gameDescriptions, sizeof(ADGameDescription), toucheGames) { _md5Bytes = 4096; _singleid = "touche"; - _flags = kADFlagPrintWarningOnFileBasedFallback; _maxScanDepth = 2; _directoryGlobs = directoryGlobs; } virtual const ADGameDescription *fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist) const { - return detectGameFilebased(allFiles, Touche::fileBasedFallback); + const ADGameDescription *matchedDesc = detectGameFilebased(allFiles, Touche::fileBasedFallback); + + if (matchedDesc) { // We got a match + Common::String report = Common::String::format(_("Your game version has been detected using " + "filename matching as a variant of %s."), matchedDesc->gameid); + report += "\n"; + report += _("If this is an original and unmodified version, please report any"); + report += "\n"; + report += _("information previously printed by ScummVM to the team."); + report += "\n"; + g_system->logMessage(LogMessageType::kInfo, report.c_str()); + } + + return matchedDesc; } virtual const char *getName() const { -- cgit v1.2.3