diff --git a/Source/Plugins/Plugin_Wiimote/Src/Config.cpp b/Source/Plugins/Plugin_Wiimote/Src/Config.cpp index b05658437d..92f40dce51 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/Config.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/Config.cpp @@ -325,12 +325,7 @@ void Config::Load() iniFile.Get(SectionName, "TriggerType", &WiiMoteEmu::WiiMapping[i].TriggerType, 0); } - // Load the IR cursor settings - iniFile.Load(FULL_CONFIG_DIR "IR Pointer.ini"); - iniFile.Get("Default", "IRLeft", &iIRLeft, LEFT); - iniFile.Get("Default", "IRTop", &iIRTop, TOP); - iniFile.Get("Default", "IRWidth", &iIRWidth, RIGHT - LEFT); - iniFile.Get("Default", "IRHeight", &iIRHeight, BOTTOM - TOP); + Config::LoadIR(); // Load a few screen settings to. If these are added to the DirectX plugin it's probably // better to place them in the main Dolphin.ini file @@ -342,6 +337,19 @@ void Config::Load() //DEBUG_LOG(WIIMOTE, "Load()"); } +void Config::LoadIR() +{ + // Load the IR cursor settings if it's avaliable for the GameId, if not load the default settings + IniFile iniFile; + char TmpSection[32]; + sprintf(TmpSection, "%s", g_ISOId ? Hex2Ascii(g_ISOId).c_str() : "Default"); + iniFile.Load(FULL_CONFIG_DIR "IR Pointer.ini"); + iniFile.Get(TmpSection, "IRLeft", &iIRLeft, LEFT); + iniFile.Get(TmpSection, "IRTop", &iIRTop, TOP); + iniFile.Get(TmpSection, "IRWidth", &iIRWidth, RIGHT - LEFT); + iniFile.Get(TmpSection, "IRHeight", &iIRHeight, BOTTOM - TOP); +} + void Config::Save() { IniFile iniFile; diff --git a/Source/Plugins/Plugin_Wiimote/Src/Config.h b/Source/Plugins/Plugin_Wiimote/Src/Config.h index 063f03e78f..18228d133e 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/Config.h +++ b/Source/Plugins/Plugin_Wiimote/Src/Config.h @@ -26,6 +26,7 @@ struct Config { Config(); void Load(); + void LoadIR(); void Save(); // For dialog sync diff --git a/Source/Plugins/Plugin_Wiimote/Src/main.cpp b/Source/Plugins/Plugin_Wiimote/Src/main.cpp index 848f5289d8..222fb3e532 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/main.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/main.cpp @@ -227,6 +227,9 @@ void Initialize(void *init) WMdisplay = (Display*)g_WiimoteInitialize.hWnd; #endif + // Load IR settings, as this is a per-game setting and the user might have loaded a different game + g_Config.LoadIR(); + g_ISOId = g_WiimoteInitialize.ISOId; DEBUG_LOG(WIIMOTE, "ISOId: %08x %s", g_WiimoteInitialize.ISOId, Hex2Ascii(g_WiimoteInitialize.ISOId).c_str());