Hopefully completely fix up the issues with the wiimote auto reconnect option not turning on/off properly.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5252 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
death2droid 2010-03-30 11:53:41 +00:00
parent 85a1b2af45
commit f56ce07c8b
3 changed files with 19 additions and 10 deletions

View File

@ -31,6 +31,8 @@ SConfig::SConfig()
LoadSettings();
//Make sure we load settings
LoadSettingsHLE();
LoadSettingsWii()
}
void SConfig::Init()
@ -248,13 +250,6 @@ void SConfig::LoadSettings()
ini.Get("Core", "TLBHack", &m_LocalCoreStartupParameter.iTLBHack, 0);
ini.Get("Core", "FrameLimit", &m_Framelimit, 1); // auto frame limit by default
//Wiimote configs
for (int i = 0; i < 4; i++)
{
char SectionName[32];
sprintf(SectionName, "Wiimote%i", i + 1);
ini.Get(SectionName, "AutoReconnectRealWiimote", &m_WiiAutoReconnect, false);
}
// 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());
@ -266,6 +261,18 @@ void SConfig::LoadSettings()
m_SYSCONF = new SysConf();
}
void SConfig::LoadSettingsWii()
{
IniFile ini;
//Wiimote configs
ini.Load((std::string(File::GetUserPath(D_CONFIG_IDX)) + "Dolphin.ini").c_str());
for (int i = 0; i < 4; i++)
{
char SectionName[32];
sprintf(SectionName, "Wiimote%i", i + 1);
ini.Get(SectionName, "AutoReconnectRealWiimote", &m_WiiAutoReconnect[i], false);
}
}
// Is this still even needed????
void SConfig::LoadSettingsHLE()

View File

@ -44,7 +44,7 @@ struct SConfig
// Wii Devices
bool m_WiiSDCard;
bool m_WiiKeyboard;
bool m_WiiAutoReconnect;
bool m_WiiAutoReconnect[4];
// DSP HLE Audio fix
bool m_EnableRE0Fix;
@ -102,6 +102,7 @@ struct SConfig
//Special load settings
void LoadSettingsHLE();
void LoadSettingsWii();
// Return the permanent and somewhat globally used instance of this struct
static SConfig& GetInstance() {return(*m_Instance);}

View File

@ -175,7 +175,8 @@ CPanel::CPanel(
{
//Auto reconnect if option is turned on.
//TODO: Make this only auto reconnect wiimotes that have the option activated.
if (SConfig::GetInstance().m_WiiAutoReconnect)
LoadSettingsWii();//Make sure we are using the newest settings.
if (SConfig::GetInstance().m_WiiAutoReconnect[1])
{
GetUsbPointer()->AccessWiiMote(lParam | 0x100)->Activate(true);
NOTICE_LOG(WIIMOTE, "Wiimote %i has been auto-reconnected...", lParam + 1);