From b47f349c96907fcb8fbb0cf5d6d3d9e26704e328 Mon Sep 17 00:00:00 2001 From: nakeee Date: Tue, 11 Nov 2008 20:59:48 +0000 Subject: [PATCH] Got rid of default Dolphin.ini Default plugins are now in Paths.h Important note for scons users, plugin names now match the one on windows!!! make sure to remove the old ones!! and update your .ini!! git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1131 8ced0084-cf51-0410-be5f-012b33b47a6e --- Binary/linux/Dolphin.ini | 5 --- Binary/win32/Dolphin.ini | 5 --- Binary/x64/Dolphin.ini | 5 --- SConstruct | 7 ++++ Source/Core/Common/Src/Common.h | 2 ++ Source/Core/Common/Src/Paths.h | 36 +++++++++++++++++++ Source/Core/DolphinWX/Src/Config.cpp | 14 ++++---- Source/Core/DolphinWX/Src/Config.h | 2 +- Source/Plugins/Plugin_DSP_HLE/Src/SConscript | 7 ++-- Source/Plugins/Plugin_DSP_LLE/Src/SConscript | 7 ++-- Source/Plugins/Plugin_DSP_NULL/Src/SConscript | 7 ++-- .../Plugins/Plugin_PadSimple/Src/SConscript | 7 ++-- Source/Plugins/Plugin_VideoOGL/Src/SConscript | 6 ++-- .../Plugin_Wiimote_Test/Src/SConscript | 7 ++-- Source/Plugins/Plugin_nJoy_SDL/Src/SConscript | 7 ++-- 15 files changed, 68 insertions(+), 56 deletions(-) delete mode 100644 Binary/linux/Dolphin.ini delete mode 100644 Binary/win32/Dolphin.ini delete mode 100644 Binary/x64/Dolphin.ini create mode 100644 Source/Core/Common/Src/Paths.h diff --git a/Binary/linux/Dolphin.ini b/Binary/linux/Dolphin.ini deleted file mode 100644 index 530b6894f7..0000000000 --- a/Binary/linux/Dolphin.ini +++ /dev/null @@ -1,5 +0,0 @@ -[Default] -GFXPlugin = Plugins/libzeroogl.so -DSPPlugin = Plugins/libdsphle.so -PadPlugin = Plugins/libPlugin_nJoy_SDL.so -WiiMotePlugin = Plugins/libPlugin_Wiimote.so diff --git a/Binary/win32/Dolphin.ini b/Binary/win32/Dolphin.ini deleted file mode 100644 index fa6fc83513..0000000000 --- a/Binary/win32/Dolphin.ini +++ /dev/null @@ -1,5 +0,0 @@ -[Default] -GFXPlugin = Plugins\Plugin_VideoOGL.dll -DSPPlugin = Plugins\Plugin_DSP_HLE.dll -PadPlugin = Plugins\Plugin_PadSimple.dll -WiiMotePlugin = Plugins\Plugin_Wiimote.dll diff --git a/Binary/x64/Dolphin.ini b/Binary/x64/Dolphin.ini deleted file mode 100644 index fa6fc83513..0000000000 --- a/Binary/x64/Dolphin.ini +++ /dev/null @@ -1,5 +0,0 @@ -[Default] -GFXPlugin = Plugins\Plugin_VideoOGL.dll -DSPPlugin = Plugins\Plugin_DSP_HLE.dll -PadPlugin = Plugins\Plugin_PadSimple.dll -WiiMotePlugin = Plugins\Plugin_Wiimote.dll diff --git a/SConstruct b/SConstruct index fe5e40366a..18631438b5 100644 --- a/SConstruct +++ b/SConstruct @@ -213,6 +213,13 @@ if not env['osx64']: # add methods from utils to env env.AddMethod(utils.filterWarnings) +# output +if sys.platform == 'darwin': + platform = 'mac' +else: + platform = 'linux' + +env['plugin_dir'] = 'Binary/%s/Plugins/' % platform Export('env') utils.GenerateRevFile(env['flavor'], "Source/Core/Common/Src/svnrev_template.h", diff --git a/Source/Core/Common/Src/Common.h b/Source/Core/Common/Src/Common.h index 4ae1b56fc5..e6c9c57de5 100644 --- a/Source/Core/Common/Src/Common.h +++ b/Source/Core/Common/Src/Common.h @@ -43,6 +43,8 @@ #include #include +#include "Paths.h" + // Function Cross-Compatibility #ifdef _WIN32 #define strcasecmp _stricmp diff --git a/Source/Core/Common/Src/Paths.h b/Source/Core/Common/Src/Paths.h new file mode 100644 index 0000000000..3d46ef7997 --- /dev/null +++ b/Source/Core/Common/Src/Paths.h @@ -0,0 +1,36 @@ +#ifndef PATHS_H +#define PATHS_H + +#define PLUGINS_DIR "Plugins" +#define DEFAULT_DATA_DIR "" +#define USERDATA_DIR "User" +#define SYSDATA_DIR "Sys" + +// Under User +#define CONFIG_DIR "Config" +#define GAMECONFIG_DIR "GameConfig" +#define CACHE_DIR "Cache" +#define SAVESTATES_DIR "SaveStates" +#define SCREENSHOTS_DIR "ScreenShots" +#define LOGS_DIR "Logs" + +// Under Sys + + +// 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" + +#ifdef _WIN32 +#define PLUGIN_SUFFIX ".dll" +#define DIR_SEP "\\" +#else +#define PLUGIN_SUFFIX ".so" +#define DIR_SEP "/" +#endif + +#endif // PATHS_H diff --git a/Source/Core/DolphinWX/Src/Config.cpp b/Source/Core/DolphinWX/Src/Config.cpp index 8cd9a758c4..85e580cbc6 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.ini"); // yes we must load first to not kill unknown stuff + // ini.Load(DOLPHIN_CONFIG); // 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.ini"); + ini.Save(DOLPHIN_CONFIG); } void SConfig::LoadSettings() { IniFile ini; - ini.Load("Dolphin.ini"); + ini.Load(DOLPHIN_CONFIG); // hard coded default plugin { - ini.Get("Default", "GFXPlugin", &m_DefaultGFXPlugin); - ini.Get("Default", "DSPPlugin", &m_DefaultDSPPlugin); - ini.Get("Default", "PadPlugin", &m_DefaultPADPlugin); - ini.Get("Default", "WiiMotePlugin", &m_DefaultWiiMotePlugin); + 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; } // misc diff --git a/Source/Core/DolphinWX/Src/Config.h b/Source/Core/DolphinWX/Src/Config.h index b3a61b2d3c..7e8e804256 100644 --- a/Source/Core/DolphinWX/Src/Config.h +++ b/Source/Core/DolphinWX/Src/Config.h @@ -25,7 +25,7 @@ struct SConfig { - // default plugins ... hard coded inside the ini + // hard coded default plugins ... std::string m_DefaultGFXPlugin; std::string m_DefaultDSPPlugin; std::string m_DefaultPADPlugin; diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/SConscript b/Source/Plugins/Plugin_DSP_HLE/Src/SConscript index b5660d5b1b..66cba3fc2d 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/SConscript +++ b/Source/Plugins/Plugin_DSP_HLE/Src/SConscript @@ -3,10 +3,7 @@ Import('env') import sys -if sys.platform == 'darwin': - output = '../../../../Binary/mac/Plugins/dsphle.so' -else: - output = '../../../../Binary/linux/Plugins/dsphle.so' +name = "Plugin_DSP_HLE.so" files = [ 'DSPHandler.cpp', @@ -36,4 +33,4 @@ dspenv.Append( LIBS = [ 'common' ], ) if not env['osx64']: - dspenv.SharedLibrary(output, files) + dspenv.SharedLibrary('../../../../'+env['plugin_dir']+name, files) diff --git a/Source/Plugins/Plugin_DSP_LLE/Src/SConscript b/Source/Plugins/Plugin_DSP_LLE/Src/SConscript index 55fe3b26dc..d7005422bd 100644 --- a/Source/Plugins/Plugin_DSP_LLE/Src/SConscript +++ b/Source/Plugins/Plugin_DSP_LLE/Src/SConscript @@ -3,10 +3,7 @@ Import('env') import sys -if sys.platform == 'darwin': - output = "../../../../Binary/mac/Plugins/dsplle.so" -else: - output = "../../../../Binary/linux/Plugins/dsplle.so" +name = "Plugin_DSP_LLE.so" files = [ "AOSoundStream.cpp", @@ -35,4 +32,4 @@ lleenv.Append( LIBS = [ 'common' ], ) if not env['osx64']: - lleenv.SharedLibrary(output, files) + lleenv.SharedLibrary('../../../../'+env['plugin_dir']+name, files) diff --git a/Source/Plugins/Plugin_DSP_NULL/Src/SConscript b/Source/Plugins/Plugin_DSP_NULL/Src/SConscript index 7158f1f3ea..c85a58f34d 100644 --- a/Source/Plugins/Plugin_DSP_NULL/Src/SConscript +++ b/Source/Plugins/Plugin_DSP_NULL/Src/SConscript @@ -3,10 +3,7 @@ Import('env') import sys -if sys.platform == 'darwin': - output = "../../../../Binary/mac/Plugins/dspnull.so" -else: - output = "../../../../Binary/linux/Plugins/dspnull.so" +name = "Plugin_DSP_NULL.so" files = [ "DSPHandler.cpp", @@ -35,4 +32,4 @@ else: LIBS = [ 'common' ], ) -dspenv.SharedLibrary(output, files) +dspenv.SharedLibrary('../../../../'+env['plugin_dir']+name, files) diff --git a/Source/Plugins/Plugin_PadSimple/Src/SConscript b/Source/Plugins/Plugin_PadSimple/Src/SConscript index 9aaa549f2c..e831bed11d 100644 --- a/Source/Plugins/Plugin_PadSimple/Src/SConscript +++ b/Source/Plugins/Plugin_PadSimple/Src/SConscript @@ -3,10 +3,7 @@ Import('env') import sys -if sys.platform == 'darwin': - output = "../../../../Binary/mac/Plugins/padsimple.so" -else: - output = "../../../../Binary/linux/Plugins/padsimple.so" +name = "Plugin_PadSimple.so" files = [ "PadSimple.cpp", @@ -27,4 +24,4 @@ if padenv['osx64']: LINKFLAGS = [ '-arch', 'x86_64' ], ) -padenv.SharedLibrary(output, files) +padenv.SharedLibrary('../../../../'+env['plugin_dir']+name, files) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/SConscript b/Source/Plugins/Plugin_VideoOGL/Src/SConscript index 38a75d3f3d..15c298d19f 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/SConscript +++ b/Source/Plugins/Plugin_VideoOGL/Src/SConscript @@ -6,6 +6,8 @@ import sys sys.path.append('../../../SconsTests') import utils +name = "Plugin_VideoOGL.so" + files = [ 'BPStructs.cpp', 'Globals.cpp', @@ -62,7 +64,6 @@ if gfxenv['osx64']: ] if sys.platform == 'darwin': - platform = 'mac' # SDL is currently the only way to get video on Mac OS X. if gfxenv['osx64']: useSDL = False @@ -78,7 +79,6 @@ if sys.platform == 'darwin': for framework in [ 'OpenGL', 'Cg' ] ] else: - platform = 'linux' # By default, GLX is used on Linux to setup OpenGL, but you can select SDL # instead if you like, by changing the line below. tests = {'CheckPKG' : utils.CheckPKG} @@ -111,7 +111,7 @@ gfxenv.Append( ) gfxenv.SharedLibrary( - '../../../../Binary/%s/Plugins/zeroogl.so' % platform, + '../../../../'+env['plugin_dir']+name, files, LIBS = libs + gfxenv['LIBS'] ) diff --git a/Source/Plugins/Plugin_Wiimote_Test/Src/SConscript b/Source/Plugins/Plugin_Wiimote_Test/Src/SConscript index d3bd9432cc..bcc3bb93e1 100644 --- a/Source/Plugins/Plugin_Wiimote_Test/Src/SConscript +++ b/Source/Plugins/Plugin_Wiimote_Test/Src/SConscript @@ -3,10 +3,7 @@ Import('env') import sys -if sys.platform == 'darwin': - output = "../../../../Binary/mac/Plugins/Plugin_Wiimote.so" -else: - output = "../../../../Binary/linux/Plugins/Plugin_Wiimote.so" +name = "Plugin_Wiimote.so" files = [ "Wiimote.cpp", @@ -26,4 +23,4 @@ else: LIBS = [ 'common' ], ) -padenv.SharedLibrary(output, files) +padenv.SharedLibrary('../../../../'+env['plugin_dir']+name, files) diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/SConscript b/Source/Plugins/Plugin_nJoy_SDL/Src/SConscript index 9a2b914b95..c3b47e72b8 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/SConscript +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/SConscript @@ -3,10 +3,7 @@ Import('env') import sys -if sys.platform == 'darwin': - output = '../../../../Binary/mac/Plugins/Plugin_nJoy_SDL.so' -else: - output = '../../../../Binary/linux/Plugins/Plugin_nJoy_SDL.so' +name = "Plugin_nJoy_SDL.so" files = [ 'nJoy.cpp', @@ -20,4 +17,4 @@ padenv.Append( LIBS = [ 'common' ], ) if not env['osx64']: - padenv.SharedLibrary(output, files) + padenv.SharedLibrary('../../../../'+env['plugin_dir']+name, files)