mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 12:44:02 +00:00
PLUGINS: In uncached mode, try plugin which matches engine name first
Trying all engine plugins in alphabetical order is a time consuming process, so start by trying the plugin which has the same name as the engine id first, if it exists, as it will usually be the right one. In the rare case that it would be the wrong one there is no problem; the code will simply fall through to the old scanning and then record the correct plugin in the engine_plugin_files domain where it will be found the next time the plugin is needed.
This commit is contained in:
parent
d2fba8fc2f
commit
47de1896b9
@ -409,6 +409,20 @@ bool PluginManagerUncached::loadPluginFromEngineId(const Common::String &engineI
|
||||
}
|
||||
}
|
||||
}
|
||||
// Check for a plugin with the same name as the engine before starting
|
||||
// to scan all plugins
|
||||
Common::String tentativeEnginePluginFilename = engineId;
|
||||
#ifdef PLUGIN_SUFFIX
|
||||
tentativeEnginePluginFilename += PLUGIN_SUFFIX;
|
||||
#endif
|
||||
for (PluginList::iterator p = _allEnginePlugins.begin(); p != _allEnginePlugins.end(); ++p) {
|
||||
Common::String filename = (*p)->getFileName();
|
||||
if (filename.hasSuffixIgnoreCase(tentativeEnginePluginFilename)) {
|
||||
if (loadPluginByFileName(filename)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user