SHARE
TWEET
Untitled
a guest
Apr 24th, 2018
69
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- diff --git a/base/plugins.cpp b/base/plugins.cpp
- index 18755003b4..571831a3c6 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/advancedDetector.cpp b/engines/advancedDetector.cpp
- index aadad74f6c..039f5826a7 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
- @@ -213,7 +213,7 @@ const ExtraGuiOptions AdvancedMetaEngine::getExtraGuiOptions(const Common::Strin
- return options;
- }
- -Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine) const {
- +Common::Error AdvancedMetaEngine::createInstance(OSystem *syst, Engine **engine, bool useUnknownGameDialog) const {
- assert(engine);
- const ADGameDescription *agdDesc = 0;
- @@ -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 5160a99679..99737e0c2c 100644
- --- a/engines/advancedDetector.h
- +++ b/engines/advancedDetector.h
- @@ -278,9 +278,9 @@ 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;
- + virtual Common::Error createInstance(OSystem *syst, Engine **engine, bool useUnknownGameDialog = false) const;
- virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) 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..8b513db397 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
- @@ -91,7 +91,7 @@ public:
- * the newly create Engine, or 0 in case of an error
- * @return a Common::Error describing the error which occurred, or kNoError
- */
- - virtual Common::Error createInstance(OSystem *syst, Engine **engine) const = 0;
- + virtual Common::Error createInstance(OSystem *syst, Engine **engine, bool useUnknownGameDialog = false) const = 0;
- /**
- * Return a list of all save states associated with the given target.
- @@ -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..6b6ef5472a 100644
- --- a/engines/scumm/detection.cpp
- +++ b/engines/scumm/detection.cpp
- @@ -563,7 +563,7 @@ static void composeFileHashMap(DescMap &fileMD5Map, const Common::FSList &fslist
- }
- }
- -static void detectGames(const Common::FSList &fslist, Common::List<DetectorResult> &results, const char *gameid) {
- +static void detectGames(const Common::FSList &fslist, Common::List<DetectorResult> &results, const char *gameid, bool useUnknownGameDialog) {
- DescMap fileMD5Map;
- DetectorResult dr;
- @@ -961,9 +961,9 @@ 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) const;
- - virtual Common::Error createInstance(OSystem *syst, Engine **engine) const;
- + virtual Common::Error createInstance(OSystem *syst, Engine **engine, bool useUnknownGameDialog) const;
- virtual SaveStateList listSaves(const char *target) const;
- virtual int getMaximumSaveSlot() const;
- @@ -1026,11 +1026,11 @@ 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;
- - ::detectGames(fslist, results, 0);
- + ::detectGames(fslist, results, 0, useUnknownGameDialog);
- for (Common::List<DetectorResult>::iterator
- x = results.begin(); x != results.end(); ++x) {
- @@ -1059,7 +1059,7 @@ GameList ScummMetaEngine::detectGames(const Common::FSList &fslist) const {
- *
- * This is heavily based on our MD5 detection scheme.
- */
- -Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) const {
- +Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine, bool useUnknownGameDialog) const {
- assert(syst);
- assert(engine);
- const char *gameid = ConfMan.get("gameid").c_str();
- @@ -1079,7 +1079,7 @@ Common::Error ScummMetaEngine::createInstance(OSystem *syst, Engine **engine) co
- // Invoke the detector, but fixed to the specified gameid.
- Common::List<DetectorResult> results;
- - ::detectGames(fslist, results, gameid);
- + ::detectGames(fslist, results, gameid, useUnknownGameDialog);
- // Unable to locate game data
- if (results.empty())
- diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp
- index b5425f9532..c2f263ca4e 100644
- --- a/engines/sky/detection.cpp
- +++ b/engines/sky/detection.cpp
- @@ -79,9 +79,9 @@ 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;
- + virtual Common::Error createInstance(OSystem *syst, Engine **engine, bool useUnknownGameDialog = false) const;
- virtual SaveStateList listSaves(const char *target) const;
- virtual int getMaximumSaveSlot() 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;
- @@ -190,7 +190,7 @@ GameList SkyMetaEngine::detectGames(const Common::FSList &fslist) const {
- return detectedGames;
- }
- -Common::Error SkyMetaEngine::createInstance(OSystem *syst, Engine **engine) const {
- +Common::Error SkyMetaEngine::createInstance(OSystem *syst, Engine **engine, bool useUnknownGameDialog) const {
- assert(engine);
- *engine = new Sky::SkyEngine(syst);
- return Common::kNoError;
- diff --git a/engines/sword1/detection.cpp b/engines/sword1/detection.cpp
- index 0b81690bc5..58f4834db5 100644
- --- a/engines/sword1/detection.cpp
- +++ b/engines/sword1/detection.cpp
- @@ -89,13 +89,13 @@ 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;
- SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
- - virtual Common::Error createInstance(OSystem *syst, Engine **engine) const;
- + virtual Common::Error createInstance(OSystem *syst, Engine **engine, bool useUnknownGameDialog = false) const;
- };
- bool SwordMetaEngine::hasFeature(MetaEngineFeature f) 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];
- @@ -241,7 +241,7 @@ GameList SwordMetaEngine::detectGames(const Common::FSList &fslist) const {
- return detectedGames;
- }
- -Common::Error SwordMetaEngine::createInstance(OSystem *syst, Engine **engine) const {
- +Common::Error SwordMetaEngine::createInstance(OSystem *syst, Engine **engine, bool useUnknownGameDialog) const {
- assert(engine);
- *engine = new Sword1::SwordEngine(syst);
- return Common::kNoError;
- diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
- index a2761eb5ce..0abf461a96 100644
- --- a/engines/sword2/sword2.cpp
- +++ b/engines/sword2/sword2.cpp
- @@ -95,12 +95,12 @@ 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;
- - virtual Common::Error createInstance(OSystem *syst, Engine **engine) const;
- + virtual Common::Error createInstance(OSystem *syst, Engine **engine, bool useUnknownGameDialog = false) const;
- };
- bool Sword2MetaEngine::hasFeature(MetaEngineFeature f) 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);
- }
- @@ -266,7 +266,7 @@ void Sword2MetaEngine::removeSaveState(const char *target, int slot) const {
- g_system->getSavefileManager()->removeSavefile(filename);
- }
- -Common::Error Sword2MetaEngine::createInstance(OSystem *syst, Engine **engine) const {
- +Common::Error Sword2MetaEngine::createInstance(OSystem *syst, Engine **engine, bool useUnknownGameDialog) const {
- assert(syst);
- assert(engine);
- @@ -278,7 +278,7 @@ Common::Error Sword2MetaEngine::createInstance(OSystem *syst, Engine **engine) c
- // Invoke the detector
- Common::String gameid = ConfMan.get("gameid");
- - GameList detectedGames = detectGames(fslist);
- + GameList detectedGames = detectGames(fslist, useUnknownGameDialog);
- for (uint i = 0; i < detectedGames.size(); i++) {
- if (detectedGames[i].gameid() == gameid) {
- 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()) {
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
