From: <sv...@op...> - 2024-08-03 16:17:15
|
Author: sagamusix Date: Sat Aug 3 18:17:02 2024 New Revision: 21321 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=21321 Log: [Reg] Remove mostly-dead fallback code when trying to load non-existent plugins: 1) OpenMPT hasn't had a Plugins directory in its installation directory from which we could load a missing plugin for years now. 2) It's highly unlikely to find a plugin in the root of the specified plugin directory (most plugin installers will put plugins in sub folders). 3) Our plugin.cache format hasn't contained pure plugin library names for many years as well, only full paths. As a result, none of the three fallback methods were likely to yield any results. Modified: trunk/OpenMPT/soundlib/plugins/PluginManager.cpp Modified: trunk/OpenMPT/soundlib/plugins/PluginManager.cpp ============================================================================== --- trunk/OpenMPT/soundlib/plugins/PluginManager.cpp Sat Aug 3 16:41:44 2024 (r21320) +++ trunk/OpenMPT/soundlib/plugins/PluginManager.cpp Sat Aug 3 18:17:02 2024 (r21321) @@ -747,40 +747,6 @@ return plugin != nullptr; } -#ifdef MODPLUG_TRACKER - bool maskCrashes = TrackerSettings::Instance().BrokenPluginsWorkaroundVSTMaskAllCrashes; - - if(!pFound && (mixPlugin.GetLibraryName() != U_(""))) - { - // Try finding the plugin DLL in the plugin directory or plugin cache instead. - mpt::PathString fullPath = TrackerSettings::Instance().PathPlugins.GetDefaultDir(); - if(fullPath.empty()) - { - fullPath = theApp.GetInstallPath() + P_("Plugins\\"); - } - fullPath += mpt::PathString::FromUnicode(mixPlugin.GetLibraryName()) + P_(".dll"); - - pFound = AddPlugin(fullPath, maskCrashes); - if(!pFound) - { - // Try plugin cache (search for library name) - SettingsContainer &cacheFile = theApp.GetPluginCache(); - mpt::ustring IDs = cacheFile.Read<mpt::ustring>(cacheSection, mixPlugin.GetLibraryName(), U_("")); - if(IDs.length() >= 16) - { - fullPath = cacheFile.Read<mpt::PathString>(cacheSection, IDs, P_("")); - if(!fullPath.empty()) - { - fullPath = theApp.PathInstallRelativeToAbsolute(fullPath); - if(mpt::native_fs{}.is_file(fullPath)) - { - pFound = AddPlugin(fullPath, maskCrashes); - } - } - } - } - } - #ifdef MPT_WITH_VST // Note: we don't check if dwPluginId1 matches Vst::kEffectMagic here, even if it should. // I have an old file I made with OpenMPT 1.17 where the primary plugin ID has an unexpected value. @@ -788,6 +754,7 @@ // after instantiating a plugin and the cached plugin ID was blindly written to the module file) if(pFound) { + bool maskCrashes = TrackerSettings::Instance().BrokenPluginsWorkaroundVSTMaskAllCrashes; Vst::AEffect *pEffect = nullptr; HINSTANCE hLibrary = nullptr; bool validPlugin = false; @@ -826,7 +793,6 @@ } #endif // MPT_WITH_VST -#endif // MODPLUG_TRACKER return false; } |