diff --git a/Source/Project64/Plugins/Plugin List.cpp b/Source/Project64/Plugins/Plugin List.cpp index 725ad27a7..73aaa4f52 100644 --- a/Source/Project64/Plugins/Plugin List.cpp +++ b/Source/Project64/Plugins/Plugin List.cpp @@ -10,6 +10,8 @@ ****************************************************************************/ #include "stdafx.h" #include +#include "Plugin List.h" +#include CPluginList::CPluginList(bool bAutoFill /* = true */) : m_PluginDir(g_Settings->LoadStringVal(Directory_Plugin), "") @@ -91,15 +93,13 @@ void CPluginList::AddPluginFromDir(CPath Dir) PLUGIN Plugin = { 0 }; Plugin.Info.MemoryBswaped = true; GetDllInfo(&Plugin.Info); - if (!ValidPluginVersion(Plugin.Info)) + if (!CPlugin::ValidPluginVersion(Plugin.Info)) { continue; } Plugin.FullPath = Dir; - std::string& fullPath = Dir; - std::string& pluginPath = m_PluginDir; - Plugin.FileName = fullPath.substr(pluginPath.length()); + Plugin.FileName = stdstr((const char *)Dir).substr(strlen(m_PluginDir)); if (GetProcAddress(hLib, "DllAbout") != NULL) { @@ -115,33 +115,3 @@ void CPluginList::AddPluginFromDir(CPath Dir) } } } - -bool CPluginList::ValidPluginVersion(PLUGIN_INFO & PluginInfo) { - switch (PluginInfo.Type) - { - case PLUGIN_TYPE_RSP: - if (!PluginInfo.MemoryBswaped) { return false; } - if (PluginInfo.Version == 0x0001) { return true; } - if (PluginInfo.Version == 0x0100) { return true; } - if (PluginInfo.Version == 0x0101) { return true; } - if (PluginInfo.Version == 0x0102) { return true; } - break; - case PLUGIN_TYPE_GFX: - if (!PluginInfo.MemoryBswaped) { return false; } - if (PluginInfo.Version == 0x0102) { return true; } - if (PluginInfo.Version == 0x0103) { return true; } - if (PluginInfo.Version == 0x0104) { return true; } - break; - case PLUGIN_TYPE_AUDIO: - if (!PluginInfo.MemoryBswaped) { return false; } - if (PluginInfo.Version == 0x0101) { return true; } - if (PluginInfo.Version == 0x0102) { return true; } - break; - case PLUGIN_TYPE_CONTROLLER: - if (PluginInfo.Version == 0x0100) { return true; } - if (PluginInfo.Version == 0x0101) { return true; } - if (PluginInfo.Version == 0x0102) { return true; } - break; - } - return FALSE; -} \ No newline at end of file diff --git a/Source/Project64/Plugins/Plugin List.h b/Source/Project64/Plugins/Plugin List.h index ae67c6805..f1ee46064 100644 --- a/Source/Project64/Plugins/Plugin List.h +++ b/Source/Project64/Plugins/Plugin List.h @@ -10,7 +10,7 @@ ****************************************************************************/ #pragma once -#include +#include class CPluginList { @@ -30,7 +30,6 @@ public: bool LoadList(void); int GetPluginCount(void) const; const PLUGIN * GetPluginInfo(int indx) const; - static bool ValidPluginVersion(PLUGIN_INFO & PluginInfo); private: typedef std::vector PluginList;