diff --git a/Source/Core/Common/Src/Paths.h b/Source/Core/Common/Src/Paths.h index 3d46ef7997..3fa1a0c7f5 100644 --- a/Source/Core/Common/Src/Paths.h +++ b/Source/Core/Common/Src/Paths.h @@ -1,8 +1,18 @@ #ifndef PATHS_H #define PATHS_H +#ifdef _WIN32 +#define PLUGIN_PREFIX "" +#define PLUGIN_SUFFIX ".dll" +#define DIR_SEP "\\" +#else +#define PLUGIN_PREFIX "lib" +#define PLUGIN_SUFFIX ".so" +#define DIR_SEP "/" +#endif + #define PLUGINS_DIR "Plugins" -#define DEFAULT_DATA_DIR "" +#define DATA_DIR "." #define USERDATA_DIR "User" #define SYSDATA_DIR "Sys" @@ -20,17 +30,15 @@ // Files #define DOLPHIN_CONFIG "Dolphin.ini" -#define DEFAULT_GFX_PLUGIN "Plugin_VideoOGL" -#define DEFAULT_DSP_PLUGIN "Plugin_DSP_HLE" -#define DEFAULT_PAD_PLUGIN "Plugin_PadSimple" -#define DEFAULT_WIIMOTE_PLUGIN "Plugin_Wiimote" +#define DEFAULT_GFX_PLUGIN PLUGIN_PREFIX "Plugin_VideoOGL" PLUGIN_SUFFIX +#define DEFAULT_DSP_PLUGIN PLUGIN_PREFIX "Plugin_DSP_HLE" PLUGIN_SUFFIX +#define DEFAULT_PAD_PLUGIN PLUGIN_PREFIX "Plugin_PadSimple" PLUGIN_SUFFIX +#define DEFAULT_WIIMOTE_PLUGIN PLUGIN_PREFIX "Plugin_Wiimote" PLUGIN_SUFFIX -#ifdef _WIN32 -#define PLUGIN_SUFFIX ".dll" -#define DIR_SEP "\\" +// shorts +#ifndef _WIN32 +#define CONFIG_FILE DOLPHIN_CONFIG #else -#define PLUGIN_SUFFIX ".so" -#define DIR_SEP "/" +#define CONFIG_FILE DATA_DIR DIR_SEP USERDATA_DIR DIR_SEP CONFIG_DIR DIR_SEP DOLPHIN_CONFIG #endif - #endif // PATHS_H diff --git a/Source/Core/DolphinWX/Src/Config.cpp b/Source/Core/DolphinWX/Src/Config.cpp index 85e580cbc6..306f13ed10 100644 --- a/Source/Core/DolphinWX/Src/Config.cpp +++ b/Source/Core/DolphinWX/Src/Config.cpp @@ -40,7 +40,7 @@ SConfig::~SConfig() void SConfig::SaveSettings() { IniFile ini; - // ini.Load(DOLPHIN_CONFIG); // yes we must load first to not kill unknown stuff + // ini.Load(CONFIG_FILE); // yes we must load first to not kill unknown stuff // misc { @@ -78,21 +78,21 @@ void SConfig::SaveSettings() ini.Set("Core", "RunCompareClient", m_LocalCoreStartupParameter.bRunCompareClient); } - ini.Save(DOLPHIN_CONFIG); + ini.Save(CONFIG_FILE); } void SConfig::LoadSettings() { IniFile ini; - ini.Load(DOLPHIN_CONFIG); + ini.Load(CONFIG_FILE); // hard coded default plugin { - m_DefaultGFXPlugin = PLUGINS_DIR DIR_SEP DEFAULT_GFX_PLUGIN PLUGIN_SUFFIX; - m_DefaultDSPPlugin = PLUGINS_DIR DIR_SEP DEFAULT_DSP_PLUGIN PLUGIN_SUFFIX; - m_DefaultPADPlugin = PLUGINS_DIR DIR_SEP DEFAULT_PAD_PLUGIN PLUGIN_SUFFIX; - m_DefaultWiiMotePlugin = PLUGINS_DIR DIR_SEP DEFAULT_WIIMOTE_PLUGIN PLUGIN_SUFFIX; + m_DefaultGFXPlugin = PLUGINS_DIR DIR_SEP DEFAULT_GFX_PLUGIN; + m_DefaultDSPPlugin = PLUGINS_DIR DIR_SEP DEFAULT_DSP_PLUGIN; + m_DefaultPADPlugin = PLUGINS_DIR DIR_SEP DEFAULT_PAD_PLUGIN; + m_DefaultWiiMotePlugin = PLUGINS_DIR DIR_SEP DEFAULT_WIIMOTE_PLUGIN; } // misc diff --git a/Source/Core/DolphinWX/Src/PluginManager.cpp b/Source/Core/DolphinWX/Src/PluginManager.cpp index 7aae3823f8..d551e41141 100644 --- a/Source/Core/DolphinWX/Src/PluginManager.cpp +++ b/Source/Core/DolphinWX/Src/PluginManager.cpp @@ -40,14 +40,10 @@ void CPluginManager::ScanForPlugins(wxWindow* _wxWindow) m_PluginInfos.clear(); CFileSearch::XStringVector Directories; - Directories.push_back(std::string("Plugins")); + Directories.push_back(std::string(PLUGINS_DIR)); CFileSearch::XStringVector Extensions; -#ifdef _WIN32 - Extensions.push_back("*.dll"); -#else - Extensions.push_back("*.so"); -#endif + Extensions.push_back("*." PLUGIN_SUFFIX); CFileSearch FileSearch(Extensions, Directories); const CFileSearch::XStringVector& rFilenames = FileSearch.GetFileNames();