mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-28 19:00:23 +00:00
Fix a couple of keymap load/save/default bugs
This commit is contained in:
parent
35894f9f77
commit
6b48dda12f
@ -622,6 +622,7 @@ void SetAxisMapping(int btn, int deviceId, int axisId, int direction, bool repla
|
||||
|
||||
// Note that it's easy to add other defaults if desired.
|
||||
void RestoreDefault() {
|
||||
g_controllerMap.clear();
|
||||
#if defined(_WIN32)
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_KEYBOARD, true);
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_X360, false);
|
||||
@ -635,6 +636,8 @@ void RestoreDefault() {
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_OUYA, true);
|
||||
} else if (name == "Sony Ericsson:R800i" || name == "Sony Ericsson:zeus") {
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_XPERIA_PLAY, true);
|
||||
} else {
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_PAD, true);
|
||||
}
|
||||
#else
|
||||
SetDefaultKeyMap(DEFAULT_MAPPING_KEYBOARD, true);
|
||||
|
@ -203,16 +203,16 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename)
|
||||
IniFile controllerIniFile;
|
||||
if (!controllerIniFile.Load(controllerIniFilename)) {
|
||||
ERROR_LOG(LOADER, "Failed to read %s. Setting controller config to default.", controllerIniFilename);
|
||||
KeyMap::RestoreDefault();
|
||||
} else {
|
||||
// Continue anyway to initialize the config. It will just restore the defaults.
|
||||
KeyMap::LoadFromIni(controllerIniFile);
|
||||
}
|
||||
|
||||
// Continue anyway to initialize the config. It will just restore the defaults.
|
||||
KeyMap::LoadFromIni(controllerIniFile);
|
||||
|
||||
CleanRecent();
|
||||
}
|
||||
|
||||
void Config::Save()
|
||||
{
|
||||
void Config::Save() {
|
||||
if (iniFilename_.size() && g_Config.bSaveSettings) {
|
||||
CleanRecent();
|
||||
IniFile iniFile;
|
||||
@ -336,10 +336,8 @@ void Config::Save()
|
||||
IniFile controllerIniFile;
|
||||
if (!controllerIniFile.Load(controllerIniFilename_.c_str())) {
|
||||
ERROR_LOG(LOADER, "Error saving config - can't read ini %s", controllerIniFilename_.c_str());
|
||||
} else {
|
||||
KeyMap::SaveToIni(controllerIniFile);
|
||||
}
|
||||
|
||||
KeyMap::SaveToIni(controllerIniFile);
|
||||
if (!controllerIniFile.Save(controllerIniFilename_.c_str())) {
|
||||
ERROR_LOG(LOADER, "Error saving config - can't write ini %s", controllerIniFilename_.c_str());
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user