[Scummvm-git-logs] scummvm master -> 54af1663053ac18d2907fe47af697aca69439f03
sev-
noreply at scummvm.org
Sun Jun 12 08:12:43 UTC 2022
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
e01416ef32 COMMON: (AD) - allow mass add to skip targets with certain ADGF flags
54af166305 COMMON: (AD) - further reduce output of mass add detection
Commit: e01416ef32ba75ce1a645bd3430ca144f3fce240
https://github.com/scummvm/scummvm/commit/e01416ef32ba75ce1a645bd3430ca144f3fce240
Author: athrxx (athrxx at scummvm.org)
Date: 2022-06-12T10:12:39+02:00
Commit Message:
COMMON: (AD) - allow mass add to skip targets with certain ADGF flags
I added skipping for the ADGF_WARNING and ADGF_UNSUPPORTED flags.
For me, this is mostly about fixing bug no. 13282. We sometimes have bogus entries which only have the purpose of presenting the error message (reasons for being unsupported) contained in the extra field of the detection entry.
Changed paths:
base/plugins.cpp
engines/adl/detection.cpp
engines/advancedDetector.cpp
engines/advancedDetector.h
engines/ags/detection.cpp
engines/ags/detection.h
engines/glk/detection.cpp
engines/glk/detection.h
engines/metaengine.h
engines/scumm/detection.cpp
engines/sky/detection.cpp
engines/sword1/detection.cpp
engines/sword2/detection.cpp
gui/massadd.cpp
diff --git a/base/plugins.cpp b/base/plugins.cpp
index 694e7bece1e..e3b1f0dc596 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -717,7 +717,7 @@ QualifiedGameList EngineManager::findGameInLoadedPlugins(const Common::String &g
return results;
}
-DetectionResults EngineManager::detectGames(const Common::FSList &fslist) {
+DetectionResults EngineManager::detectGames(const Common::FSList &fslist, uint32 skipADFlags) {
DetectedGames candidates;
PluginList plugins;
PluginList::const_iterator iter;
@@ -735,7 +735,7 @@ DetectionResults EngineManager::detectGames(const Common::FSList &fslist) {
MetaEngineDetection &metaEngine = (*iter)->get<MetaEngineDetection>();
// set the debug flags
DebugMan.addAllDebugChannels(metaEngine.getDebugChannels());
- DetectedGames engineCandidates = metaEngine.detectGames(fslist);
+ DetectedGames engineCandidates = metaEngine.detectGames(fslist, skipADFlags);
for (uint i = 0; i < engineCandidates.size(); i++) {
engineCandidates[i].path = fslist.begin()->getParent().getPath();
diff --git a/engines/adl/detection.cpp b/engines/adl/detection.cpp
index 0355b6b8232..37009499226 100644
--- a/engines/adl/detection.cpp
+++ b/engines/adl/detection.cpp
@@ -488,7 +488,7 @@ public:
return debugFlagList;
}
- ADDetectedGames detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra) override;
+ ADDetectedGames detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, uint32 skipADFlags) override;
bool addFileProps(const FileMap &allFiles, Common::String fname, FilePropertiesMap &filePropsMap) const;
};
@@ -512,9 +512,9 @@ bool AdlMetaEngineDetection::addFileProps(const FileMap &allFiles, Common::Strin
}
// Based on AdvancedMetaEngine::detectGame
-ADDetectedGames AdlMetaEngineDetection::detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra) {
+ADDetectedGames AdlMetaEngineDetection::detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, uint32 skipADFlags) {
// We run the file-based detector first, if it finds a match we do not search for disk images
- ADDetectedGames matched = AdvancedMetaEngineDetection::detectGame(parent, allFiles, language, platform, extra);
+ ADDetectedGames matched = AdvancedMetaEngineDetection::detectGame(parent, allFiles, language, platform, extra, skipADFlags);
if (!matched.empty())
return matched;
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index 2c2e676aa50..18fda81b8db 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -252,7 +252,7 @@ bool AdvancedMetaEngineDetection::cleanupPirated(ADDetectedGames &matched) const
return false;
}
-DetectedGames AdvancedMetaEngineDetection::detectGames(const Common::FSList &fslist) {
+DetectedGames AdvancedMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 skipADFlags) {
FileMap allFiles;
if (fslist.empty())
@@ -266,7 +266,7 @@ DetectedGames AdvancedMetaEngineDetection::detectGames(const Common::FSList &fsl
composeFileHashMap(allFiles, fslist, (_maxScanDepth == 0 ? 1 : _maxScanDepth));
// Run the detector on this
- ADDetectedGames matches = detectGame(fslist.begin()->getParent(), allFiles, Common::UNK_LANG, Common::kPlatformUnknown, "");
+ ADDetectedGames matches = detectGame(fslist.begin()->getParent(), allFiles, Common::UNK_LANG, Common::kPlatformUnknown, "", skipADFlags);
cleanupPirated(matches);
@@ -573,7 +573,7 @@ static bool getFilePropertiesIntern(uint md5Bytes, const AdvancedMetaEngine::Fil
return true;
}
-ADDetectedGames AdvancedMetaEngineDetection::detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra) {
+ADDetectedGames AdvancedMetaEngineDetection::detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, uint32 skipADFlags) {
FilePropertiesMap filesProps;
ADDetectedGames matched;
@@ -627,6 +627,11 @@ ADDetectedGames AdvancedMetaEngineDetection::detectGame(const Common::FSNode &pa
if ((_flags & kADFlagUseExtraAsHint) && !extra.empty() && g->extra != extra)
continue;
+ if (g->flags & skipADFlags) {
+ debugC(3, kDebugGlobalDetection, "Skipping unsupported target for engine '%s' for the following reasons:\n\t'%s'", g->gameId, g->extra);
+ continue;
+ }
+
ADDetectedGame game(g);
bool allFilesPresent = true;
int curFilesMatched = 0;
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h
index 5e78b0c9380..6b51e1a9124 100644
--- a/engines/advancedDetector.h
+++ b/engines/advancedDetector.h
@@ -358,7 +358,7 @@ public:
* (possibly empty) list of games supported by the engine that were
* found among the given files.
*/
- DetectedGames detectGames(const Common::FSList &fslist) override;
+ DetectedGames detectGames(const Common::FSList &fslist, uint32 skipADFlags) override;
/**
* A generic createInstance.
@@ -419,15 +419,16 @@ protected:
* Parameters @p language and @p platform are used to pass the values
* specified by the user. This is used to restrict search scope.
*
- * @param parent Parent node of this file node.
- * @param allFiles List of all present files, as computed by the @ref composeFileHashMap.
- * @param language Restrict results to the specified language.
- * @param platform Restrict results to the specified platform.
- * @param extra Restrict results to the specified @c extra string (only if @ref kADFlagUseExtraAsHint is set).
+ * @param parent Parent node of this file node.
+ * @param allFiles List of all present files, as computed by the @ref composeFileHashMap.
+ * @param language Restrict results to the specified language.
+ * @param platform Restrict results to the specified platform.
+ * @param extra Restrict results to the specified @c extra string (only if @ref kADFlagUseExtraAsHint is set).
+ * @param skipADFlags Specify bitmask of ADGF flags to be ignored (for mass add).
*
* @return A list of @ref ADGameDescription pointers corresponding to the matched games.
*/
- virtual ADDetectedGames detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra);
+ virtual ADDetectedGames detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, uint32 skipADFlags = 0);
/**
* @return True if variant of a game with unknown files can be played with the engine and false otherwise.
diff --git a/engines/ags/detection.cpp b/engines/ags/detection.cpp
index 45260adb145..ea9ea85e9eb 100644
--- a/engines/ags/detection.cpp
+++ b/engines/ags/detection.cpp
@@ -74,7 +74,7 @@ AGSMetaEngineDetection::AGSMetaEngineDetection() : AdvancedMetaEngineDetection(A
sizeof(AGS::AGSGameDescription), AGS::GAME_NAMES) {
}
-DetectedGames AGSMetaEngineDetection::detectGames(const Common::FSList &fslist) {
+DetectedGames AGSMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 skipADFlags) {
FileMap allFiles;
if (fslist.empty())
@@ -84,7 +84,7 @@ DetectedGames AGSMetaEngineDetection::detectGames(const Common::FSList &fslist)
composeFileHashMap(allFiles, fslist, (_maxScanDepth == 0 ? 1 : _maxScanDepth));
// Run the detector on this
- ADDetectedGames matches = detectGame(fslist.begin()->getParent(), allFiles, Common::UNK_LANG, Common::kPlatformUnknown, "");
+ ADDetectedGames matches = detectGame(fslist.begin()->getParent(), allFiles, Common::UNK_LANG, Common::kPlatformUnknown, "", skipADFlags);
cleanupPirated(matches);
diff --git a/engines/ags/detection.h b/engines/ags/detection.h
index 59728685316..b5032a85915 100644
--- a/engines/ags/detection.h
+++ b/engines/ags/detection.h
@@ -86,7 +86,7 @@ public:
return debugFlagList;
}
- DetectedGames detectGames(const Common::FSList &fslist) override;
+ DetectedGames detectGames(const Common::FSList &fslist, uint32 skipADFlags) override;
ADDetectedGame fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist, ADDetectedGameExtraInfo **extra = nullptr) const override;
diff --git a/engines/glk/detection.cpp b/engines/glk/detection.cpp
index eaccd819e46..b8cf789529c 100644
--- a/engines/glk/detection.cpp
+++ b/engines/glk/detection.cpp
@@ -180,7 +180,7 @@ PlainGameDescriptor GlkMetaEngineDetection::findGame(const char *gameId) const {
#undef FIND_GAME
-DetectedGames GlkMetaEngineDetection::detectGames(const Common::FSList &fslist) {
+DetectedGames GlkMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) {
#ifndef RELEASE_BUILD
// This is as good a place as any to detect multiple sub-engines using the same Ids
detectClashes();
diff --git a/engines/glk/detection.h b/engines/glk/detection.h
index e433eb91bf8..c990057e28b 100644
--- a/engines/glk/detection.h
+++ b/engines/glk/detection.h
@@ -56,7 +56,7 @@ public:
* (possibly empty) list of games supported by the engine which it was able
* to detect amongst the given files.
*/
- DetectedGames detectGames(const Common::FSList &fslist) override;
+ DetectedGames detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) override;
/**
* Query the engine for a PlainGameDescriptor for the specified gameid, if any.
diff --git a/engines/metaengine.h b/engines/metaengine.h
index f35ff98a618..3ded2c1c2e3 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -157,7 +157,7 @@ public:
* (possibly empty) list of games supported by the engine that were
* found among the given files.
*/
- virtual DetectedGames detectGames(const Common::FSList &fslist) = 0;
+ virtual DetectedGames detectGames(const Common::FSList &fslist, uint32 skipADFlags = 0) = 0;
/**
* Return a list of extra GUI options for the specified target.
@@ -574,10 +574,10 @@ class EngineManager : public Common::Singleton<EngineManager> {
public:
/**
* Given a list of FSNodes in a given directory, detect a set of games contained within.
- *
+ * @ param skipADFlags Ignore results which are flagged with the ADGF flags specified here (for mass add)
* Returns an empty list if none are found.
*/
- DetectionResults detectGames(const Common::FSList &fslist);
+ DetectionResults detectGames(const Common::FSList &fslist, uint32 skipADFlags = 0);
/** Find a plugin by its engine ID. */
const Plugin *findPlugin(const Common::String &engineId) const;
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index a8351bad242..51122a1c6aa 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -82,7 +82,7 @@ public:
PlainGameList getSupportedGames() const override;
PlainGameDescriptor findGame(const char *gameid) const override;
- DetectedGames detectGames(const Common::FSList &fslist) override;
+ DetectedGames detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) override;
const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const override;
};
@@ -121,7 +121,7 @@ static Common::String generatePreferredTarget(const DetectorResult &x) {
return res;
}
-DetectedGames ScummMetaEngineDetection::detectGames(const Common::FSList &fslist) {
+DetectedGames ScummMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) {
DetectedGames detectedGames;
Common::List<DetectorResult> results;
::detectGames(fslist, results, nullptr);
diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp
index bd0d971a948..afb4f8855ea 100644
--- a/engines/sky/detection.cpp
+++ b/engines/sky/detection.cpp
@@ -76,7 +76,7 @@ public:
PlainGameList getSupportedGames() const override;
const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const override;
PlainGameDescriptor findGame(const char *gameid) const override;
- DetectedGames detectGames(const Common::FSList &fslist) override;
+ DetectedGames detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) override;
};
const char *SkyMetaEngineDetection::getName() const {
@@ -118,7 +118,7 @@ PlainGameDescriptor SkyMetaEngineDetection::findGame(const char *gameid) const {
return PlainGameDescriptor::empty();
}
-DetectedGames SkyMetaEngineDetection::detectGames(const Common::FSList &fslist) {
+DetectedGames SkyMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) {
DetectedGames detectedGames;
bool hasSkyDsk = false;
bool hasSkyDnr = false;
diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp
index 8eaf2612703..8065d815579 100644
--- a/engines/sword1/detection.cpp
+++ b/engines/sword1/detection.cpp
@@ -85,7 +85,7 @@ public:
PlainGameList getSupportedGames() const override;
PlainGameDescriptor findGame(const char *gameId) const override;
- DetectedGames detectGames(const Common::FSList &fslist) override;
+ DetectedGames detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) override;
};
PlainGameList SwordMetaEngineDetection::getSupportedGames() const {
@@ -132,7 +132,7 @@ void Sword1CheckDirectory(const Common::FSList &fslist, bool *filesFound) {
}
}
-DetectedGames SwordMetaEngineDetection::detectGames(const Common::FSList &fslist) {
+DetectedGames SwordMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) {
int i, j;
DetectedGames detectedGames;
bool filesFound[NUM_FILES_TO_CHECK];
diff --git a/engines/sword2/detection.cpp b/engines/sword2/detection.cpp
index 5ac8914220f..9b21e57cb2f 100644
--- a/engines/sword2/detection.cpp
+++ b/engines/sword2/detection.cpp
@@ -53,7 +53,7 @@ public:
PlainGameList getSupportedGames() const override;
const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const override;
PlainGameDescriptor findGame(const char *gameid) const override;
- DetectedGames detectGames(const Common::FSList &fslist) override;
+ DetectedGames detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) override;
};
PlainGameList Sword2MetaEngineDetection::getSupportedGames() const {
@@ -82,7 +82,7 @@ PlainGameDescriptor Sword2MetaEngineDetection::findGame(const char *gameid) cons
return PlainGameDescriptor::of(g->gameid, g->description);
}
-DetectedGames Sword2MetaEngineDetection::detectGames(const Common::FSList &fslist) {
+DetectedGames Sword2MetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) {
// The required game data files can be located in the game directory, or in
// a subdirectory called "clusters". In the latter case, we don't want to
// detect the game in that subdirectory, as this will detect the game twice
diff --git a/gui/massadd.cpp b/gui/massadd.cpp
index 018c96bee7e..3c4db548aaa 100644
--- a/gui/massadd.cpp
+++ b/gui/massadd.cpp
@@ -27,6 +27,8 @@
#include "common/taskbar.h"
#include "common/translation.h"
+#include "engines/advancedDetector.h"
+
#include "gui/massadd.h"
#ifndef DISABLE_MASS_ADD
@@ -174,7 +176,7 @@ void MassAddDialog::handleTickle() {
}
// Run the detector on the dir
- DetectionResults detectionResults = EngineMan.detectGames(files);
+ DetectionResults detectionResults = EngineMan.detectGames(files, (ADGF_WARNING | ADGF_UNSUPPORTED));
if (detectionResults.foundUnknownGames()) {
Common::U32String report = detectionResults.generateUnknownGameReport(false, 80);
Commit: 54af1663053ac18d2907fe47af697aca69439f03
https://github.com/scummvm/scummvm/commit/54af1663053ac18d2907fe47af697aca69439f03
Author: athrxx (athrxx at scummvm.org)
Date: 2022-06-12T10:12:39+02:00
Commit Message:
COMMON: (AD) - further reduce output of mass add detection
Follow-up to the feature that allows skipping certain ADGF flags.
This here now also allows skipping of incomplete file/md5/size matches. It is basically the same behavior as the graylist. For the mass add all files are treated as if they are on the list.
Changed paths:
base/plugins.cpp
engines/adl/detection.cpp
engines/advancedDetector.cpp
engines/advancedDetector.h
engines/ags/detection.cpp
engines/ags/detection.h
engines/glk/detection.cpp
engines/glk/detection.h
engines/metaengine.h
engines/scumm/detection.cpp
engines/sky/detection.cpp
engines/sword1/detection.cpp
engines/sword2/detection.cpp
gui/massadd.cpp
diff --git a/base/plugins.cpp b/base/plugins.cpp
index e3b1f0dc596..fc5043e3541 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -717,7 +717,7 @@ QualifiedGameList EngineManager::findGameInLoadedPlugins(const Common::String &g
return results;
}
-DetectionResults EngineManager::detectGames(const Common::FSList &fslist, uint32 skipADFlags) {
+DetectionResults EngineManager::detectGames(const Common::FSList &fslist, uint32 skipADFlags, bool skipIncomplete) {
DetectedGames candidates;
PluginList plugins;
PluginList::const_iterator iter;
@@ -735,7 +735,7 @@ DetectionResults EngineManager::detectGames(const Common::FSList &fslist, uint32
MetaEngineDetection &metaEngine = (*iter)->get<MetaEngineDetection>();
// set the debug flags
DebugMan.addAllDebugChannels(metaEngine.getDebugChannels());
- DetectedGames engineCandidates = metaEngine.detectGames(fslist, skipADFlags);
+ DetectedGames engineCandidates = metaEngine.detectGames(fslist, skipADFlags, skipIncomplete);
for (uint i = 0; i < engineCandidates.size(); i++) {
engineCandidates[i].path = fslist.begin()->getParent().getPath();
diff --git a/engines/adl/detection.cpp b/engines/adl/detection.cpp
index 37009499226..80303cd94b8 100644
--- a/engines/adl/detection.cpp
+++ b/engines/adl/detection.cpp
@@ -488,7 +488,7 @@ public:
return debugFlagList;
}
- ADDetectedGames detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, uint32 skipADFlags) override;
+ ADDetectedGames detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, uint32 skipADFlags, bool skipIncomplete) override;
bool addFileProps(const FileMap &allFiles, Common::String fname, FilePropertiesMap &filePropsMap) const;
};
@@ -512,9 +512,9 @@ bool AdlMetaEngineDetection::addFileProps(const FileMap &allFiles, Common::Strin
}
// Based on AdvancedMetaEngine::detectGame
-ADDetectedGames AdlMetaEngineDetection::detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, uint32 skipADFlags) {
+ADDetectedGames AdlMetaEngineDetection::detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, uint32 skipADFlags, bool skipIncomplete) {
// We run the file-based detector first, if it finds a match we do not search for disk images
- ADDetectedGames matched = AdvancedMetaEngineDetection::detectGame(parent, allFiles, language, platform, extra, skipADFlags);
+ ADDetectedGames matched = AdvancedMetaEngineDetection::detectGame(parent, allFiles, language, platform, extra, skipADFlags, skipIncomplete);
if (!matched.empty())
return matched;
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index 18fda81b8db..4bbd3b6295a 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -252,7 +252,7 @@ bool AdvancedMetaEngineDetection::cleanupPirated(ADDetectedGames &matched) const
return false;
}
-DetectedGames AdvancedMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 skipADFlags) {
+DetectedGames AdvancedMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 skipADFlags, bool skipIncomplete) {
FileMap allFiles;
if (fslist.empty())
@@ -266,7 +266,7 @@ DetectedGames AdvancedMetaEngineDetection::detectGames(const Common::FSList &fsl
composeFileHashMap(allFiles, fslist, (_maxScanDepth == 0 ? 1 : _maxScanDepth));
// Run the detector on this
- ADDetectedGames matches = detectGame(fslist.begin()->getParent(), allFiles, Common::UNK_LANG, Common::kPlatformUnknown, "", skipADFlags);
+ ADDetectedGames matches = detectGame(fslist.begin()->getParent(), allFiles, Common::UNK_LANG, Common::kPlatformUnknown, "", skipADFlags, skipIncomplete);
cleanupPirated(matches);
@@ -573,7 +573,7 @@ static bool getFilePropertiesIntern(uint md5Bytes, const AdvancedMetaEngine::Fil
return true;
}
-ADDetectedGames AdvancedMetaEngineDetection::detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, uint32 skipADFlags) {
+ADDetectedGames AdvancedMetaEngineDetection::detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, uint32 skipADFlags, bool skipIncomplete) {
FilePropertiesMap filesProps;
ADDetectedGames matched;
@@ -678,10 +678,9 @@ ADDetectedGames AdvancedMetaEngineDetection::detectGame(const Common::FSNode &pa
// cases.
if (allFilesPresent && !gotAnyMatchesWithAllFiles) {
// Do sanity check
- if (game.hasUnknownFiles && isEntryGrayListed(g)) {
- debugC(3, kDebugGlobalDetection, "Skipping game: %s (%s %s/%s) (%d), didn't pass sanity", g->gameId, g->extra,
- getPlatformDescription(g->platform), getLanguageDescription(g->language), i);
-
+ if (game.hasUnknownFiles && (skipIncomplete || isEntryGrayListed(g))) {
+ debugC(3, kDebugGlobalDetection, "Skipping game: %s (%s %s/%s) (%d), %s %s", g->gameId, g->extra, getPlatformDescription(g->platform),
+ getLanguageDescription(g->language), i, skipIncomplete ? "(ignore incomplete matches)" : "", isEntryGrayListed(g) ? "(didn't pass sanity test)" : "");
continue;
}
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h
index 6b51e1a9124..959482ded9c 100644
--- a/engines/advancedDetector.h
+++ b/engines/advancedDetector.h
@@ -358,7 +358,7 @@ public:
* (possibly empty) list of games supported by the engine that were
* found among the given files.
*/
- DetectedGames detectGames(const Common::FSList &fslist, uint32 skipADFlags) override;
+ DetectedGames detectGames(const Common::FSList &fslist, uint32 skipADFlags, bool skipIncomplete) override;
/**
* A generic createInstance.
@@ -419,16 +419,17 @@ protected:
* Parameters @p language and @p platform are used to pass the values
* specified by the user. This is used to restrict search scope.
*
- * @param parent Parent node of this file node.
- * @param allFiles List of all present files, as computed by the @ref composeFileHashMap.
- * @param language Restrict results to the specified language.
- * @param platform Restrict results to the specified platform.
- * @param extra Restrict results to the specified @c extra string (only if @ref kADFlagUseExtraAsHint is set).
- * @param skipADFlags Specify bitmask of ADGF flags to be ignored (for mass add).
+ * @param parent Parent node of this file node.
+ * @param allFiles List of all present files, as computed by the @ref composeFileHashMap.
+ * @param language Restrict results to the specified language.
+ * @param platform Restrict results to the specified platform.
+ * @param extra Restrict results to the specified @c extra string (only if @ref kADFlagUseExtraAsHint is set).
+ * @param skipADFlags Specify bitmask of ADGF flags to be ignored (for mass add).
+ * @param skipIncomplete Ignore results with incomplete file/md5/size matches (for mass add).
*
* @return A list of @ref ADGameDescription pointers corresponding to the matched games.
*/
- virtual ADDetectedGames detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, uint32 skipADFlags = 0);
+ virtual ADDetectedGames detectGame(const Common::FSNode &parent, const FileMap &allFiles, Common::Language language, Common::Platform platform, const Common::String &extra, uint32 skipADFlags = 0, bool skipIncomplete = false);
/**
* @return True if variant of a game with unknown files can be played with the engine and false otherwise.
diff --git a/engines/ags/detection.cpp b/engines/ags/detection.cpp
index ea9ea85e9eb..f745306791b 100644
--- a/engines/ags/detection.cpp
+++ b/engines/ags/detection.cpp
@@ -74,7 +74,7 @@ AGSMetaEngineDetection::AGSMetaEngineDetection() : AdvancedMetaEngineDetection(A
sizeof(AGS::AGSGameDescription), AGS::GAME_NAMES) {
}
-DetectedGames AGSMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 skipADFlags) {
+DetectedGames AGSMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 skipADFlags, bool skipIncomplete) {
FileMap allFiles;
if (fslist.empty())
@@ -84,7 +84,7 @@ DetectedGames AGSMetaEngineDetection::detectGames(const Common::FSList &fslist,
composeFileHashMap(allFiles, fslist, (_maxScanDepth == 0 ? 1 : _maxScanDepth));
// Run the detector on this
- ADDetectedGames matches = detectGame(fslist.begin()->getParent(), allFiles, Common::UNK_LANG, Common::kPlatformUnknown, "", skipADFlags);
+ ADDetectedGames matches = detectGame(fslist.begin()->getParent(), allFiles, Common::UNK_LANG, Common::kPlatformUnknown, "", skipADFlags, skipIncomplete);
cleanupPirated(matches);
diff --git a/engines/ags/detection.h b/engines/ags/detection.h
index b5032a85915..04997abeba2 100644
--- a/engines/ags/detection.h
+++ b/engines/ags/detection.h
@@ -86,7 +86,7 @@ public:
return debugFlagList;
}
- DetectedGames detectGames(const Common::FSList &fslist, uint32 skipADFlags) override;
+ DetectedGames detectGames(const Common::FSList &fslist, uint32 skipADFlags, bool skipIncomplete) override;
ADDetectedGame fallbackDetect(const FileMap &allFiles, const Common::FSList &fslist, ADDetectedGameExtraInfo **extra = nullptr) const override;
diff --git a/engines/glk/detection.cpp b/engines/glk/detection.cpp
index b8cf789529c..0f9828a64a6 100644
--- a/engines/glk/detection.cpp
+++ b/engines/glk/detection.cpp
@@ -180,7 +180,7 @@ PlainGameDescriptor GlkMetaEngineDetection::findGame(const char *gameId) const {
#undef FIND_GAME
-DetectedGames GlkMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) {
+DetectedGames GlkMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/, bool /*skipIncomplete*/) {
#ifndef RELEASE_BUILD
// This is as good a place as any to detect multiple sub-engines using the same Ids
detectClashes();
diff --git a/engines/glk/detection.h b/engines/glk/detection.h
index c990057e28b..6eace38a28e 100644
--- a/engines/glk/detection.h
+++ b/engines/glk/detection.h
@@ -56,7 +56,7 @@ public:
* (possibly empty) list of games supported by the engine which it was able
* to detect amongst the given files.
*/
- DetectedGames detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) override;
+ DetectedGames detectGames(const Common::FSList &fslist, uint32 /*skipUnsupported*/, bool /*skipIncomplete*/) override;
/**
* Query the engine for a PlainGameDescriptor for the specified gameid, if any.
diff --git a/engines/metaengine.h b/engines/metaengine.h
index 3ded2c1c2e3..4465a5c1276 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -157,7 +157,7 @@ public:
* (possibly empty) list of games supported by the engine that were
* found among the given files.
*/
- virtual DetectedGames detectGames(const Common::FSList &fslist, uint32 skipADFlags = 0) = 0;
+ virtual DetectedGames detectGames(const Common::FSList &fslist, uint32 skipADFlags = 0, bool skipIncomplete = false) = 0;
/**
* Return a list of extra GUI options for the specified target.
@@ -575,9 +575,10 @@ public:
/**
* Given a list of FSNodes in a given directory, detect a set of games contained within.
* @ param skipADFlags Ignore results which are flagged with the ADGF flags specified here (for mass add)
+ * @ param skipIncomplete Ignore incomplete file/md5/size matches (for mass add)
* Returns an empty list if none are found.
*/
- DetectionResults detectGames(const Common::FSList &fslist, uint32 skipADFlags = 0);
+ DetectionResults detectGames(const Common::FSList &fslist, uint32 skipADFlags = 0, bool skipIncomplete = false);
/** Find a plugin by its engine ID. */
const Plugin *findPlugin(const Common::String &engineId) const;
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 51122a1c6aa..ef6293b9ceb 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -82,7 +82,7 @@ public:
PlainGameList getSupportedGames() const override;
PlainGameDescriptor findGame(const char *gameid) const override;
- DetectedGames detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) override;
+ DetectedGames detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/, bool /*skipIncomplete*/) override;
const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const override;
};
@@ -121,7 +121,7 @@ static Common::String generatePreferredTarget(const DetectorResult &x) {
return res;
}
-DetectedGames ScummMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) {
+DetectedGames ScummMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/, bool /*skipIncomplete*/) {
DetectedGames detectedGames;
Common::List<DetectorResult> results;
::detectGames(fslist, results, nullptr);
diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp
index afb4f8855ea..17c0ceac5c6 100644
--- a/engines/sky/detection.cpp
+++ b/engines/sky/detection.cpp
@@ -76,7 +76,7 @@ public:
PlainGameList getSupportedGames() const override;
const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const override;
PlainGameDescriptor findGame(const char *gameid) const override;
- DetectedGames detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) override;
+ DetectedGames detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/, bool /*skipIncomplete*/) override;
};
const char *SkyMetaEngineDetection::getName() const {
@@ -118,7 +118,7 @@ PlainGameDescriptor SkyMetaEngineDetection::findGame(const char *gameid) const {
return PlainGameDescriptor::empty();
}
-DetectedGames SkyMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) {
+DetectedGames SkyMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/, bool /*skipIncomplete*/) {
DetectedGames detectedGames;
bool hasSkyDsk = false;
bool hasSkyDnr = false;
diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp
index 8065d815579..929cb2bc0fb 100644
--- a/engines/sword1/detection.cpp
+++ b/engines/sword1/detection.cpp
@@ -85,7 +85,7 @@ public:
PlainGameList getSupportedGames() const override;
PlainGameDescriptor findGame(const char *gameId) const override;
- DetectedGames detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) override;
+ DetectedGames detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/, bool /*skipIncomplete*/) override;
};
PlainGameList SwordMetaEngineDetection::getSupportedGames() const {
@@ -132,7 +132,7 @@ void Sword1CheckDirectory(const Common::FSList &fslist, bool *filesFound) {
}
}
-DetectedGames SwordMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) {
+DetectedGames SwordMetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/, bool /*skipIncomplete*/) {
int i, j;
DetectedGames detectedGames;
bool filesFound[NUM_FILES_TO_CHECK];
diff --git a/engines/sword2/detection.cpp b/engines/sword2/detection.cpp
index 9b21e57cb2f..c74139f293a 100644
--- a/engines/sword2/detection.cpp
+++ b/engines/sword2/detection.cpp
@@ -53,7 +53,7 @@ public:
PlainGameList getSupportedGames() const override;
const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const override;
PlainGameDescriptor findGame(const char *gameid) const override;
- DetectedGames detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) override;
+ DetectedGames detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/, bool /*skipIncomplete*/) override;
};
PlainGameList Sword2MetaEngineDetection::getSupportedGames() const {
@@ -82,7 +82,7 @@ PlainGameDescriptor Sword2MetaEngineDetection::findGame(const char *gameid) cons
return PlainGameDescriptor::of(g->gameid, g->description);
}
-DetectedGames Sword2MetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/) {
+DetectedGames Sword2MetaEngineDetection::detectGames(const Common::FSList &fslist, uint32 /*skipADFlags*/, bool /*skipIncomplete*/) {
// The required game data files can be located in the game directory, or in
// a subdirectory called "clusters". In the latter case, we don't want to
// detect the game in that subdirectory, as this will detect the game twice
diff --git a/gui/massadd.cpp b/gui/massadd.cpp
index 3c4db548aaa..8a3cbb4cdbf 100644
--- a/gui/massadd.cpp
+++ b/gui/massadd.cpp
@@ -176,7 +176,7 @@ void MassAddDialog::handleTickle() {
}
// Run the detector on the dir
- DetectionResults detectionResults = EngineMan.detectGames(files, (ADGF_WARNING | ADGF_UNSUPPORTED));
+ DetectionResults detectionResults = EngineMan.detectGames(files, (ADGF_WARNING | ADGF_UNSUPPORTED), true);
if (detectionResults.foundUnknownGames()) {
Common::U32String report = detectionResults.generateUnknownGameReport(false, 80);
More information about the Scummvm-git-logs
mailing list