diff options
author | Thierry Crozat | 2019-04-27 02:34:48 +0100 |
---|---|---|
committer | Thierry Crozat | 2019-04-27 02:34:48 +0100 |
commit | 40c9930699ab0ee3fc84e40800eb50794c9d93ff (patch) | |
tree | 98c764cc742275df6dd4e100d987760a1f891958 | |
parent | fb0fc9bb7ac24e821bf4e642a2a40f3ac1df5087 (diff) | |
download | scummvm-rg350-40c9930699ab0ee3fc84e40800eb50794c9d93ff.tar.gz scummvm-rg350-40c9930699ab0ee3fc84e40800eb50794c9d93ff.tar.bz2 scummvm-rg350-40c9930699ab0ee3fc84e40800eb50794c9d93ff.zip |
ENGINES: Add function in DetectionResults to get list of engines with an unknown variants
-rw-r--r-- | engines/game.cpp | 17 | ||||
-rw-r--r-- | engines/game.h | 8 |
2 files changed, 23 insertions, 2 deletions
diff --git a/engines/game.cpp b/engines/game.cpp index ee14acf7c8..bb5f4ae6cb 100644 --- a/engines/game.cpp +++ b/engines/game.cpp @@ -142,7 +142,7 @@ bool DetectionResults::foundUnknownGames() const { return false; } -DetectedGames DetectionResults::listRecognizedGames() { +DetectedGames DetectionResults::listRecognizedGames() const { DetectedGames candidates; for (uint i = 0; i < _detectedGames.size(); i++) { if (_detectedGames[i].canBeAdded) { @@ -214,3 +214,18 @@ Common::String DetectionResults::generateUnknownGameReport(bool translate, uint3 return report; } + +Common::StringArray DetectionResults::getUnknownGameEngines() const { + Common::StringArray engines; + const char *currentEngineName = nullptr; + for (uint i = 0; i < _detectedGames.size(); i++) { + const DetectedGame &game = _detectedGames[i]; + if (!game.hasUnknownFiles) + continue; + if (!currentEngineName || strcmp(currentEngineName, game.engineName) != 0) { + currentEngineName = game.engineName; + engines.push_back(Common::String(currentEngineName)); + } + } + return engines; +} diff --git a/engines/game.h b/engines/game.h index 304166d05f..fcaae62e5c 100644 --- a/engines/game.h +++ b/engines/game.h @@ -26,6 +26,7 @@ #include "common/array.h" #include "common/hash-str.h" #include "common/str.h" +#include "common/str-array.h" #include "common/language.h" #include "common/platform.h" @@ -198,7 +199,7 @@ public: * * Recognized games can be added to the configuration manager and then launched. */ - DetectedGames listRecognizedGames(); + DetectedGames listRecognizedGames() const; /** * Were unknown game variants found by the engines? @@ -216,6 +217,11 @@ public: */ Common::String generateUnknownGameReport(bool translate, uint32 wordwrapAt = 0) const; + /** + * Get the list of engines for which an unknown game variant was found. + */ + Common::StringArray getUnknownGameEngines() const; + private: DetectedGames _detectedGames; }; |