From 6d11f46b15f9f69fd6c36c26b672b3f5b91f2142 Mon Sep 17 00:00:00 2001 From: Eric Culp Date: Tue, 12 Jun 2012 15:03:51 -0400 Subject: BASE: Only reload engine plugins after return to launcher The other plugins do not need to be reloaded. Reloading the scaler plugins breaks the graphics. --- base/plugins.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'base/plugins.cpp') diff --git a/base/plugins.cpp b/base/plugins.cpp index f4d18efb1c..55c99b1eda 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -379,6 +379,30 @@ void PluginManager::loadAllPlugins() { } } +void PluginManager::loadAllPluginsOfType(PluginType type) { + for (ProviderList::iterator pp = _providers.begin(); + pp != _providers.end(); + ++pp) { + PluginList pl((*pp)->getPlugins()); + for (PluginList::iterator p = pl.begin(); + p != pl.end(); + ++p) { + if ((*p)->loadPlugin()) { + if ((*p)->getType() == type) { + addToPluginsInMemList((*p)); + } else { + // Plugin is wrong type + (*p)->unloadPlugin(); + delete (*p); + } + } else { + // Plugin did not load + delete (*p); + } + } + } +} + void PluginManager::unloadAllPlugins() { for (int i = 0; i < PLUGIN_TYPE_MAX; i++) unloadPluginsExcept((PluginType)i, NULL); -- cgit v1.2.3