mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-26 07:43:36 +01:00
Step 1: Go back to a single control map.
Break save/load for now, it will be redone.
This commit is contained in:
1 parent
33beb57a31
commit
f1bc751eb9
7 files changed
+195
-173
No files matched your search
+27
-5
@@ -33,9 +33,10 @@ extern bool isJailed;
|
||||
Config::Config() { }
|
||||
Config::~Config() { }
|
||||
|
||||
void Config::Load(const char *iniFileName)
|
||||
void Config::Load(const char *iniFileName, const char *controllerIniFilename)
|
||||
{
|
||||
iniFilename_ = iniFileName;
|
||||
controllerIniFilename_ = controllerIniFilename;
|
||||
INFO_LOG(LOADER, "Loading config: %s", iniFileName);
|
||||
bSaveSettings = true;
|
||||
|
||||
@@ -188,7 +189,16 @@ void Config::Load(const char *iniFileName)
|
||||
IniFile::Section *gleshacks = iniFile.GetOrCreateSection("GLESHacks");
|
||||
gleshacks->Get("PrescaleUV", &bPrescaleUV, false);
|
||||
|
||||
KeyMap::LoadFromIni(iniFile);
|
||||
INFO_LOG(LOADER, "Loading controller config: %s", controllerIniFilename);
|
||||
bSaveSettings = true;
|
||||
|
||||
IniFile controllerIniFile;
|
||||
if (!controllerIniFile.Load(controllerIniFilename)) {
|
||||
ERROR_LOG(LOADER, "Failed to read %s. Setting controller config to default.", controllerIniFilename);
|
||||
}
|
||||
|
||||
// Continue anyway to initialize the config. It will just restore the defaults.
|
||||
KeyMap::LoadFromIni(controllerIniFile);
|
||||
|
||||
CleanRecent();
|
||||
}
|
||||
@@ -305,14 +315,26 @@ void Config::Save()
|
||||
debugConfig->Set("FontWidth", iFontWidth);
|
||||
debugConfig->Set("FontHeight", iFontHeight);
|
||||
debugConfig->Set("DisplayStatusBar", bDisplayStatusBar);
|
||||
|
||||
KeyMap::SaveToIni(iniFile);
|
||||
|
||||
if (!iniFile.Save(iniFilename_.c_str())) {
|
||||
ERROR_LOG(LOADER, "Error saving config - can't write ini %s", iniFilename_.c_str());
|
||||
return;
|
||||
}
|
||||
INFO_LOG(LOADER, "Config saved: %s", iniFilename_.c_str());
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if (!controllerIniFile.Save(controllerIniFilename_.c_str())) {
|
||||
ERROR_LOG(LOADER, "Error saving config - can't write ini %s", controllerIniFilename_.c_str());
|
||||
return;
|
||||
}
|
||||
INFO_LOG(LOADER, "Controller config saved: %s", controllerIniFilename_.c_str());
|
||||
|
||||
} else {
|
||||
INFO_LOG(LOADER, "Not saving config");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user