aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base/plugins.cpp4
-rw-r--r--engines/adl/detection.cpp8
-rw-r--r--engines/advancedDetector.cpp12
-rw-r--r--engines/advancedDetector.h6
-rw-r--r--engines/metaengine.h4
-rw-r--r--engines/scumm/detection.cpp4
-rw-r--r--engines/sky/detection.cpp4
-rw-r--r--engines/sword1/detection.cpp4
-rw-r--r--engines/sword2/sword2.cpp4
-rw-r--r--gui/launcher.cpp2
10 files changed, 26 insertions, 26 deletions
diff --git a/base/plugins.cpp b/base/plugins.cpp
index b8f63fd443..852786919b 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -514,7 +514,7 @@ GameDescriptor EngineManager::findGameInLoadedPlugins(const Common::String &game
return result;
}
-GameList EngineManager::detectGames(const Common::FSList &fslist) const {
+GameList EngineManager::detectGames(const Common::FSList &fslist, bool useUnknownGameDialog) const {
GameList candidates;
PluginList plugins;
PluginList::const_iterator iter;
@@ -524,7 +524,7 @@ GameList EngineManager::detectGames(const Common::FSList &fslist) const {
// Iterate over all known games and for each check if it might be
// the game in the presented directory.
for (iter = plugins.begin(); iter != plugins.end(); ++iter) {
- candidates.push_back((*iter)->get<MetaEngine>().detectGames(fslist));
+ candidates.push_back((*iter)->get<MetaEngine>().detectGames(fslist, useUnknownGameDialog));
}
} while (PluginManager::instance().loadNextPlugin());
return candidates;
diff --git a/engines/adl/detection.cpp b/engines/adl/detection.cpp
index ab634bc02a..14646c78e3 100644
--- a/engines/adl/detection.cpp
+++ b/engines/adl/detection.cpp
@@ -332,7 +332,7 @@ public:
int getMaximumSaveSlot() const { return 'O' - 'A'; }
SaveStateList listSaves(const char *target) const;
void removeSaveState(const char *target, int slot) const;
- virtual ADGameDescList detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra) const;
+ virtual ADGameDescList detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, bool useUnknownGameDialog = false) const;
bool addFileProps(const FileMap &allFiles, Common::String fname, ADFilePropertiesMap &filePropsMap) const;
@@ -511,9 +511,9 @@ bool AdlMetaEngine::addFileProps(const FileMap &allFiles, Common::String fname,
}
// Based on AdvancedMetaEngine::detectGame
-ADGameDescList AdlMetaEngine::detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra) const {
+ADGameDescList AdlMetaEngine::detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, bool useUnknownGameDialog) const {
// We run the file-based detector first and then add to the returned list
- ADGameDescList matched = AdvancedMetaEngine::detectGame(parent, allFiles, language, platform, extra);
+ ADGameDescList matched = AdvancedMetaEngine::detectGame(parent, allFiles, language, platform, extra, useUnknownGameDialog);
debug(3, "Starting disk image detection in dir '%s'", parent.getPath().c_str());
@@ -605,7 +605,7 @@ ADGameDescList AdlMetaEngine::detectGame(const Common::FSNode &parent, const Fil
// TODO: This could be improved to handle matched and unknown games together in a single directory
if (matched.empty()) {
if (!filesProps.empty() && gotAnyMatchesWithAllFiles) {
- reportUnknown(parent, filesProps, matchedGameIds);
+ reportUnknown(parent, filesProps, matchedGameIds, useUnknownGameDialog);
}
}
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index 1cf18f01a0..dbe2cdfd68 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -150,7 +150,7 @@ bool cleanupPirated(ADGameDescList &matched) {
}
-GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const {
+GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist, bool useUnknownGameDialog) const {
ADGameDescList matches;
GameList detectedGames;
FileMap allFiles;
@@ -162,7 +162,7 @@ GameList AdvancedMetaEngine::detectGames(const Common::FSList &fslist) const {
composeFileHashMap(allFiles, fslist, (_maxScanDepth == 0 ? 1 : _maxScanDepth));
// Run the detector on this
- matches = detectGame(fslist.begin()->getParent(), allFiles, Common::UNK_LANG, Common::kPlatformUnknown, "");
+ matches = detectGame(fslist.begin()->getParent(), allFiles, Common::UNK_LANG, Common::kPlatformUnknown, "", useUnknownGameDialog);
if (matches.empty()) {
// Use fallback detector if there were no matches by other means
@@ -327,7 +327,7 @@ Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine)
return Common::kNoError;
}
-void AdvancedMetaEngine::reportUnknown(const Common::FSNode &path, const ADFilePropertiesMap &filesProps, const ADGameIdList &matchedGameIds) const {
+void AdvancedMetaEngine::reportUnknown(const Common::FSNode &path, const ADFilePropertiesMap &filesProps, const ADGameIdList &matchedGameIds, bool useUnknownGameDialog) const {
const char *reportCommon = "The game in '%s' seems to be an unknown %s engine game "
"variant.\n\nPlease report the following data to the ScummVM "
"team at %s along with the name of the game you tried to add and "
@@ -373,7 +373,7 @@ void AdvancedMetaEngine::reportUnknown(const Common::FSNode &path, const ADFileP
g_system->logMessage(LogMessageType::kInfo, reportLog.c_str());
// Check if the GUI is running, show the UnknownGameDialog and print the translated unknown game information
- if (GUI::GuiManager::hasInstance() && g_gui.isActive()) {
+ if (GUI::GuiManager::hasInstance() && g_gui.isActive() && useUnknownGameDialog == true) {
UnknownGameDialog dialog(report, reportTranslated, bugtrackerAffectedEngine);
dialog.runModal();
}
@@ -449,7 +449,7 @@ bool AdvancedMetaEngine::getFileProperties(const Common::FSNode &parent, const F
return true;
}
-ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra) const {
+ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, bool useUnknownGameDialog) const {
ADFilePropertiesMap filesProps;
const ADGameFileDescription *fileDesc;
@@ -574,7 +574,7 @@ ADGameDescList AdvancedMetaEngine::detectGame(const Common::FSNode &parent, cons
// We didn't find a match
if (matched.empty()) {
if (!filesProps.empty() && gotAnyMatchesWithAllFiles) {
- reportUnknown(parent, filesProps, matchedGameIds);
+ reportUnknown(parent, filesProps, matchedGameIds, useUnknownGameDialog);
}
// Filename based fallback
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h
index 7bd7de3eb8..d7e85f86fe 100644
--- a/engines/advancedDetector.h
+++ b/engines/advancedDetector.h
@@ -278,7 +278,7 @@ public:
virtual GameDescriptor findGame(const char *gameId) const;
- virtual GameList detectGames(const Common::FSList &fslist) const;
+ virtual GameList detectGames(const Common::FSList &fslist, bool useUnknownGameDialog = false) const;
virtual Common::Error createInstance(OSystem *syst, Engine **engine) const;
@@ -313,7 +313,7 @@ protected:
* @param extra restrict results to specified extra string (only if kADFlagUseExtraAsHint is set)
* @return list of ADGameDescription pointers corresponding to matched games
*/
- virtual ADGameDescList detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra) const;
+ virtual ADGameDescList detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, bool useUnknownGameDialog = false) const;
/**
* Iterates over all ADFileBasedFallback records inside fileBasedFallback.
@@ -333,7 +333,7 @@ protected:
* Log and print a report that we found an unknown game variant, together with the file
* names, sizes and MD5 sums.
*/
- void reportUnknown(const Common::FSNode &path, const ADFilePropertiesMap &filesProps, const ADGameIdList &matchedGameIds = ADGameIdList()) const;
+ void reportUnknown(const Common::FSNode &path, const ADFilePropertiesMap &filesProps, const ADGameIdList &matchedGameIds = ADGameIdList(), bool useUnknownGameDialog = false) const;
// TODO
void updateGameDescriptor(GameDescriptor &desc, const ADGameDescription *realDesc) const;
diff --git a/engines/metaengine.h b/engines/metaengine.h
index b3aaa96a8f..68f4b36848 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -79,7 +79,7 @@ public:
* (possibly empty) list of games supported by the engine which it was able
* to detect amongst the given files.
*/
- virtual GameList detectGames(const Common::FSList &fslist) const = 0;
+ virtual GameList detectGames(const Common::FSList &fslist, bool useUnknownGameDialog = false) const = 0;
/**
* Tries to instantiate an engine instance based on the settings of
@@ -269,7 +269,7 @@ class EngineManager : public Common::Singleton<EngineManager> {
public:
GameDescriptor findGameInLoadedPlugins(const Common::String &gameName, const Plugin **plugin = NULL) const;
GameDescriptor findGame(const Common::String &gameName, const Plugin **plugin = NULL) const;
- GameList detectGames(const Common::FSList &fslist) const;
+ GameList detectGames(const Common::FSList &fslist, bool useUnknownGameDialog = false) const;
const PluginList &getPlugins() const;
};
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 0aa993a53a..37302e31d7 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -961,7 +961,7 @@ public:
virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
virtual GameDescriptor findGame(const char *gameid) const;
- virtual GameList detectGames(const Common::FSList &fslist) const;
+ virtual GameList detectGames(const Common::FSList &fslist, bool useUnknownGameDialog = false) const;
virtual Common::Error createInstance(OSystem *syst, Engine **engine) const;
@@ -1026,7 +1026,7 @@ static Common::String generatePreferredTarget(const DetectorResult &x) {
return res;
}
-GameList ScummMetaEngine::detectGames(const Common::FSList &fslist) const {
+GameList ScummMetaEngine::detectGames(const Common::FSList &fslist, bool /*useUnknownGameDialog*/) const {
GameList detectedGames;
Common::List<DetectorResult> results;
diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp
index b5425f9532..a74b63fb8c 100644
--- a/engines/sky/detection.cpp
+++ b/engines/sky/detection.cpp
@@ -79,7 +79,7 @@ public:
virtual GameList getSupportedGames() const;
virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const;
virtual GameDescriptor findGame(const char *gameid) const;
- virtual GameList detectGames(const Common::FSList &fslist) const;
+ virtual GameList detectGames(const Common::FSList &fslist, bool useUnknownGameDialog = false) const;
virtual Common::Error createInstance(OSystem *syst, Engine **engine) const;
@@ -141,7 +141,7 @@ GameDescriptor SkyMetaEngine::findGame(const char *gameid) const {
return GameDescriptor();
}
-GameList SkyMetaEngine::detectGames(const Common::FSList &fslist) const {
+GameList SkyMetaEngine::detectGames(const Common::FSList &fslist, bool /*useUnknownGameDialog*/) const {
GameList detectedGames;
bool hasSkyDsk = false;
bool hasSkyDnr = false;
diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp
index 0b81690bc5..ddfc4b8c14 100644
--- a/engines/sword1/detection.cpp
+++ b/engines/sword1/detection.cpp
@@ -89,7 +89,7 @@ public:
virtual bool hasFeature(MetaEngineFeature f) const;
virtual GameList getSupportedGames() const;
virtual GameDescriptor findGame(const char *gameid) const;
- virtual GameList detectGames(const Common::FSList &fslist) const;
+ virtual GameList detectGames(const Common::FSList &fslist, bool useUnknownGameDialog = false) const;
virtual SaveStateList listSaves(const char *target) const;
virtual int getMaximumSaveSlot() const;
virtual void removeSaveState(const char *target, int slot) const;
@@ -175,7 +175,7 @@ void Sword1CheckDirectory(const Common::FSList &fslist, bool *filesFound, bool r
}
}
-GameList SwordMetaEngine::detectGames(const Common::FSList &fslist) const {
+GameList SwordMetaEngine::detectGames(const Common::FSList &fslist, bool /*useUnknownGameDialog*/) const {
int i, j;
GameList detectedGames;
bool filesFound[NUM_FILES_TO_CHECK];
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index a2761eb5ce..10ddda7d2e 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -95,7 +95,7 @@ public:
virtual GameList getSupportedGames() const;
virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const;
virtual GameDescriptor findGame(const char *gameid) const;
- virtual GameList detectGames(const Common::FSList &fslist) const;
+ virtual GameList detectGames(const Common::FSList &fslist, bool useUnknownGameDialog = false) const;
virtual SaveStateList listSaves(const char *target) const;
virtual int getMaximumSaveSlot() const;
virtual void removeSaveState(const char *target, int slot) const;
@@ -223,7 +223,7 @@ GameList detectGamesImpl(const Common::FSList &fslist, bool recursion = false) {
return detectedGames;
}
-GameList Sword2MetaEngine::detectGames(const Common::FSList &fslist) const {
+GameList Sword2MetaEngine::detectGames(const Common::FSList &fslist, bool /*useUnknownGameDialog*/) const {
return detectGamesImpl(fslist);
}
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 4fe1ae79c8..857d7d001a 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -573,7 +573,7 @@ bool LauncherDialog::doGameDetection(const Common::String &path) {
// ...so let's determine a list of candidates, games that
// could be contained in the specified directory.
- GameList candidates(EngineMan.detectGames(files));
+ GameList candidates(EngineMan.detectGames(files, true));
int idx;
if (candidates.empty()) {