mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 13:20:27 -06:00
Revised r4853, config default settings will be used for games that do not have IR Pointer settings yet (falling back to hardcoded values if even those are missing)
Fixes issue 2045 git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4882 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -342,12 +342,21 @@ void Config::LoadIR()
|
|||||||
// Load the IR cursor settings if it's avaliable for the GameId, if not load the default settings
|
// Load the IR cursor settings if it's avaliable for the GameId, if not load the default settings
|
||||||
IniFile iniFile;
|
IniFile iniFile;
|
||||||
char TmpSection[32];
|
char TmpSection[32];
|
||||||
|
int defaultLeft, defaultTop, defaultWidth, defaultHeight;
|
||||||
|
|
||||||
sprintf(TmpSection, "%s", g_ISOId ? Hex2Ascii(g_ISOId).c_str() : "Default");
|
sprintf(TmpSection, "%s", g_ISOId ? Hex2Ascii(g_ISOId).c_str() : "Default");
|
||||||
iniFile.Load(FULL_CONFIG_DIR "IR Pointer.ini");
|
iniFile.Load(FULL_CONFIG_DIR "IR Pointer.ini");
|
||||||
iniFile.Get(TmpSection, "IRLeft", &iIRLeft, LEFT);
|
//Load defaults first...
|
||||||
iniFile.Get(TmpSection, "IRTop", &iIRTop, TOP);
|
iniFile.Get("Default", "IRLeft", &defaultLeft, LEFT);
|
||||||
iniFile.Get(TmpSection, "IRWidth", &iIRWidth, RIGHT - LEFT);
|
iniFile.Get("Default", "IRTop", &defaultTop, TOP);
|
||||||
iniFile.Get(TmpSection, "IRHeight", &iIRHeight, BOTTOM - TOP);
|
iniFile.Get("Default", "IRWidth", &defaultWidth, RIGHT - LEFT);
|
||||||
|
iniFile.Get("Default", "IRHeight", &defaultHeight, BOTTOM - TOP);
|
||||||
|
//...and fall back to them if the GameId is not found.
|
||||||
|
//It shouldn't matter if we read Default twice, its in memory anyways.
|
||||||
|
iniFile.Get(TmpSection, "IRLeft", &iIRLeft, defaultLeft);
|
||||||
|
iniFile.Get(TmpSection, "IRTop", &iIRTop, defaultTop);
|
||||||
|
iniFile.Get(TmpSection, "IRWidth", &iIRWidth, defaultWidth);
|
||||||
|
iniFile.Get(TmpSection, "IRHeight", &iIRHeight, defaultHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Config::Save()
|
void Config::Save()
|
||||||
|
Reference in New Issue
Block a user