From 943df64b329d1fc4ddfa6f6cc711a76b3887d528 Mon Sep 17 00:00:00 2001 From: aryanrawlani28 Date: Wed, 29 Jul 2020 05:39:24 +0530 Subject: [PATCH] ENGINES: Change behaviour of EngineMan::getPlugins. - Changed so we can get any type of plugins. - This used to always return PLUGIN_TYPE_ENGINE. - Because now we can differentiate between engines and metaengine, this must be changed. - For now, return METAENGINE by default --- base/plugins.cpp | 4 ++-- engines/metaengine.h | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/base/plugins.cpp b/base/plugins.cpp index 54ae118f242..441fddc79e1 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -652,8 +652,8 @@ DetectionResults EngineManager::detectGames(const Common::FSList &fslist) const return DetectionResults(candidates); } -const PluginList &EngineManager::getPlugins() const { - return PluginManager::instance().getPlugins(PLUGIN_TYPE_ENGINE); +const PluginList &EngineManager::getPlugins(const PluginType fetchPluginType) const { + return PluginManager::instance().getPlugins(fetchPluginType); } namespace { diff --git a/engines/metaengine.h b/engines/metaengine.h index 7e9657b7cfd..64248bf81af 100644 --- a/engines/metaengine.h +++ b/engines/metaengine.h @@ -416,8 +416,14 @@ public: /** Find a plugin by its engine ID */ const Plugin *findPlugin(const Common::String &engineId) const; - /** Get the list of all engine plugins */ - const PluginList &getPlugins() const; + /** + * Get the list of all plugins for the type specified. + * By default, it will get METAENGINES, for now. + * If usage of actual engines never occurs, we can skip + * the default arguments, and always have it return + * PLUGIN_TYPE_METAENGINE. + */ + const PluginList &getPlugins(const PluginType fetchPluginType = PLUGIN_TYPE_METAENGINE) const; /** Find a target */ QualifiedGameDescriptor findTarget(const Common::String &target, const Plugin **plugin = NULL) const;