diff --git a/Source/Core/DolphinWX/Src/Config.cpp b/Source/Core/Core/Src/ConfigManager.cpp similarity index 80% rename from Source/Core/DolphinWX/Src/Config.cpp rename to Source/Core/Core/Src/ConfigManager.cpp index ce9fb7ce1e..1c9c4acb6f 100644 --- a/Source/Core/DolphinWX/Src/Config.cpp +++ b/Source/Core/Core/Src/ConfigManager.cpp @@ -17,10 +17,9 @@ #include -#include "Globals.h" #include "Common.h" #include "IniFile.h" -#include "Config.h" +#include "ConfigManager.h" #ifdef __APPLE__ #include #include @@ -92,8 +91,14 @@ void SConfig::SaveSettings() // Plugins ini.Set("Core", "GFXPlugin", m_LocalCoreStartupParameter.m_strVideoPlugin); ini.Set("Core", "DSPPlugin", m_LocalCoreStartupParameter.m_strDSPPlugin); - ini.Set("Core", "PadPlugin", m_LocalCoreStartupParameter.m_strPadPlugin); - ini.Set("Core", "WiiMotePlugin", m_LocalCoreStartupParameter.m_strWiimotePlugin); + ini.Set("Core", "Pad1Plugin", m_LocalCoreStartupParameter.m_strPadPlugin[0]); + ini.Set("Core", "Pad2Plugin", m_LocalCoreStartupParameter.m_strPadPlugin[1]); + ini.Set("Core", "Pad3Plugin", m_LocalCoreStartupParameter.m_strPadPlugin[2]); + ini.Set("Core", "Pad4Plugin", m_LocalCoreStartupParameter.m_strPadPlugin[3]); + ini.Set("Core", "WiiMote1Plugin", m_LocalCoreStartupParameter.m_strWiimotePlugin[0]); + ini.Set("Core", "WiiMote2Plugin", m_LocalCoreStartupParameter.m_strWiimotePlugin[1]); + ini.Set("Core", "WiiMote3Plugin", m_LocalCoreStartupParameter.m_strWiimotePlugin[2]); + ini.Set("Core", "WiiMote4Plugin", m_LocalCoreStartupParameter.m_strWiimotePlugin[3]); } ini.Save(CONFIG_FILE); @@ -186,7 +191,13 @@ void SConfig::LoadSettings() // Plugins ini.Get("Core", "GFXPlugin", &m_LocalCoreStartupParameter.m_strVideoPlugin, m_DefaultGFXPlugin.c_str()); ini.Get("Core", "DSPPlugin", &m_LocalCoreStartupParameter.m_strDSPPlugin, m_DefaultDSPPlugin.c_str()); - ini.Get("Core", "PadPlugin", &m_LocalCoreStartupParameter.m_strPadPlugin, m_DefaultPADPlugin.c_str()); - ini.Get("Core", "WiiMotePlugin", &m_LocalCoreStartupParameter.m_strWiimotePlugin, m_DefaultWiiMotePlugin.c_str()); + ini.Get("Core", "Pad1Plugin", &m_LocalCoreStartupParameter.m_strPadPlugin[0], m_DefaultPADPlugin.c_str()); + ini.Get("Core", "Pad2Plugin", &m_LocalCoreStartupParameter.m_strPadPlugin[1], m_DefaultPADPlugin.c_str()); + ini.Get("Core", "Pad3Plugin", &m_LocalCoreStartupParameter.m_strPadPlugin[2], m_DefaultPADPlugin.c_str()); + ini.Get("Core", "Pad4Plugin", &m_LocalCoreStartupParameter.m_strPadPlugin[3], m_DefaultPADPlugin.c_str()); + ini.Get("Core", "WiiMote1Plugin", &m_LocalCoreStartupParameter.m_strWiimotePlugin[0], m_DefaultWiiMotePlugin.c_str()); + ini.Get("Core", "WiiMote2Plugin", &m_LocalCoreStartupParameter.m_strWiimotePlugin[1], m_DefaultWiiMotePlugin.c_str()); + ini.Get("Core", "WiiMote3Plugin", &m_LocalCoreStartupParameter.m_strWiimotePlugin[2], m_DefaultWiiMotePlugin.c_str()); + ini.Get("Core", "WiiMote4Plugin", &m_LocalCoreStartupParameter.m_strWiimotePlugin[3], m_DefaultWiiMotePlugin.c_str()); } } diff --git a/Source/Core/DolphinWX/Src/Config.h b/Source/Core/Core/Src/ConfigManager.h similarity index 100% rename from Source/Core/DolphinWX/Src/Config.h rename to Source/Core/Core/Src/ConfigManager.h diff --git a/Source/Core/Core/Src/CoreParameter.h b/Source/Core/Core/Src/CoreParameter.h index 8c1c83bb13..ab9f1461d0 100644 --- a/Source/Core/Core/Src/CoreParameter.h +++ b/Source/Core/Core/Src/CoreParameter.h @@ -24,6 +24,8 @@ #include +#define MAXPADS 4 +#define MAXWIIMOTES 4 struct SCoreStartupParameter { @@ -89,9 +91,9 @@ struct SCoreStartupParameter // files std::string m_strVideoPlugin; - std::string m_strPadPlugin; + std::string m_strPadPlugin[MAXPADS]; std::string m_strDSPPlugin; - std::string m_strWiimotePlugin; + std::string m_strWiimotePlugin[MAXWIIMOTES]; std::string m_strFilename; std::string m_strBios; diff --git a/Source/Core/Core/Src/PluginManager.cpp b/Source/Core/Core/Src/PluginManager.cpp index 9f0fbbffc2..b10aa4b0ea 100644 --- a/Source/Core/Core/Src/PluginManager.cpp +++ b/Source/Core/Core/Src/PluginManager.cpp @@ -69,17 +69,33 @@ bool CPluginManager::InitPlugins(SCoreStartupParameter scsp) { if (!m_video) return false; - for (int i=0;i<1;i++) { - m_pad[i] = (Common::PluginPAD*)LoadPlugin(scsp.m_strPadPlugin.c_str()); - if (m_pad[i] == NULL) - return false; + bool pad = false; + bool wiimote = false; + + for (int i=0;i @@ -64,7 +64,7 @@ #include "PowerPC/Jit64/JitCache.h" // for ClearCache() #include "PluginManager.h" -#include "../../DolphinWX/Src/Config.h" +#include "ConfigManager.h" extern "C" // Bitmaps @@ -80,7 +80,7 @@ extern "C" // Bitmaps ////////////////////////////////////////////////////////////////////////////////////////// // Declarations and definitions -// ¯¯¯¯¯¯¯¯¯¯ +// ¯¯¯¯¯¯¯¯¯¯ // and here are the classes class CPluginInfo; class CPluginManager; diff --git a/Source/Core/DolphinWX/Src/BootManager.cpp b/Source/Core/DolphinWX/Src/BootManager.cpp index 47f84b2bf3..5bab67003c 100644 --- a/Source/Core/DolphinWX/Src/BootManager.cpp +++ b/Source/Core/DolphinWX/Src/BootManager.cpp @@ -49,7 +49,7 @@ #include "ISOFile.h" #include "Volume.h" #include "VolumeCreator.h" -#include "Config.h" +#include "ConfigManager.h" #include "Core.h" #if defined(HAVE_WX) && HAVE_WX #include "ConfigMain.h" diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index dfa3426b17..5a7af934c0 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -26,6 +26,7 @@ #include "Globals.h" // Local #include "ConfigMain.h" #include "PluginManager.h" +#include "ConfigManager.h" #include "Frame.h" ////////////////////////////////////// @@ -407,8 +408,11 @@ void CConfigMain::CreateGUIControls() FillChoiceBox(GraphicSelection, PLUGIN_TYPE_VIDEO, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin); FillChoiceBox(DSPSelection, PLUGIN_TYPE_DSP, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin); - FillChoiceBox(PADSelection, PLUGIN_TYPE_PAD, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin); - FillChoiceBox(WiimoteSelection, PLUGIN_TYPE_WIIMOTE, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin); + for (int i=0;iAdd(GraphicSelection, 1, wxEXPAND|wxALL, 5); @@ -646,8 +650,14 @@ void CConfigMain::OnSelectionChanged(wxCommandEvent& WXUNUSED (event)) { GetFilename(GraphicSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strVideoPlugin); GetFilename(DSPSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin); - GetFilename(PADSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin); - GetFilename(WiimoteSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin); + GetFilename(PADSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin[0]); + GetFilename(PADSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin[1]); + GetFilename(PADSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin[2]); + GetFilename(PADSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin[3]); + GetFilename(WiimoteSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin[0]); + GetFilename(WiimoteSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin[1]); + GetFilename(WiimoteSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin[2]); + GetFilename(WiimoteSelection, SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin[3]); } void CConfigMain::OnConfig(wxCommandEvent& event) diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index d5c6f884b3..b22eb5af39 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -48,7 +48,7 @@ be accessed from Core::GetWindowHandle(). #include "FileUtil.h" #include "Timer.h" -#include "Config.h" // Core +#include "ConfigManager.h" // Core #include "Core.h" #include "HW/DVDInterface.h" #include "State.h" diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 0701902eaa..49412aa510 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -19,7 +19,7 @@ ////////////////////////////////////////////////////////////////////////////////////////// // Windows -/* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯ +/* ¯¯¯¯¯¯¯¯¯¯¯¯¯¯ CFrame is the main parent window. Inside CFrame there is m_Panel which is the parent for the rendering window (when we render to the main window). In Windows the rendering window is @@ -48,7 +48,7 @@ be accessed from Core::GetWindowHandle(). #include "FileUtil.h" #include "Timer.h" -#include "Config.h" // Core +#include "ConfigManager.h" // Core #include "Core.h" #include "HW/DVDInterface.h" #include "State.h" @@ -202,7 +202,7 @@ void CFrame::PopulateToolbar(wxToolBar* toolBar) ////////////////////////////////////////////////// // Music mod - // ¯¯¯¯¯¯¯¯¯¯ + // ¯¯¯¯¯¯¯¯¯¯ #ifdef MUSICMOD MM_PopulateGUI(); #endif @@ -217,7 +217,7 @@ void CFrame::PopulateToolbar(wxToolBar* toolBar) ////////////////////////////////////////////////// // Delete and recreate the toolbar -// ¯¯¯¯¯¯¯¯¯¯ +// ¯¯¯¯¯¯¯¯¯¯ void CFrame::RecreateToolbar() { @@ -556,14 +556,14 @@ void CFrame::OnPluginPAD(wxCommandEvent& WXUNUSED (event)) { CPluginManager::GetInstance().OpenConfig( GetHandle(), - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin.c_str() + SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin[0].c_str() ); } void CFrame::OnPluginWiimote(wxCommandEvent& WXUNUSED (event)) { CPluginManager::GetInstance().OpenConfig( GetHandle(), - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin.c_str() + SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin[0].c_str() ); } diff --git a/Source/Core/DolphinWX/Src/FrameWiimote.cpp b/Source/Core/DolphinWX/Src/FrameWiimote.cpp index 50ef28ba0a..dc5b947916 100644 --- a/Source/Core/DolphinWX/Src/FrameWiimote.cpp +++ b/Source/Core/DolphinWX/Src/FrameWiimote.cpp @@ -25,7 +25,7 @@ #include "BootManager.h" #include "Common.h" -#include "Config.h" +#include "ConfigManager.h" #include "Core.h" #include "State.h" #include "ConfigMain.h" diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp index d0130618e1..061dd30ef8 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp @@ -24,7 +24,7 @@ #include "FileSearch.h" #include "FileUtil.h" #include "StringUtil.h" -#include "Config.h" +#include "ConfigManager.h" #include "GameListCtrl.h" #include "Blob.h" #include "ISOProperties.h" diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index 89e23679a6..5c1f43b362 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -41,7 +41,7 @@ #include "Main.h" // Local #include "Frame.h" -#include "Config.h" +#include "ConfigManager.h" #include "CodeWindow.h" #include "LogWindow.h" #include "ExtendedTrace.h" diff --git a/Source/Core/DolphinWX/Src/SConscript b/Source/Core/DolphinWX/Src/SConscript index 9726ee2964..ea2d0d334e 100644 --- a/Source/Core/DolphinWX/Src/SConscript +++ b/Source/Core/DolphinWX/Src/SConscript @@ -7,7 +7,7 @@ wxenv = env.Clone() files = [ 'BootManager.cpp', - 'Config.cpp', +# 'Config.cpp', 'cmdline.c', ] diff --git a/Source/Plugins/Plugin_PadSimpleEvnt/Src/PadSimple.cpp b/Source/Plugins/Plugin_PadSimpleEvnt/Src/PadSimple.cpp index 26a2440cd0..861f0067ba 100644 --- a/Source/Plugins/Plugin_PadSimpleEvnt/Src/PadSimple.cpp +++ b/Source/Plugins/Plugin_PadSimpleEvnt/Src/PadSimple.cpp @@ -122,7 +122,7 @@ bool registerKey(int nPad, int id, sf::Key::Code code, int mods) { // Might be not be registered yet - // eventHandler->RemoveEventListener(oldKey); + eventHandler->RemoveEventListener(oldKey); } pad[nPad].keyForControl[id] = code;