mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-25 23:33:41 +01:00
Fix bAutoRun config option, add to menu. (Run on Load).
This commit is contained in:
1 parent
f8ae18a130
commit
a9c171c786
11 files changed
+112
-128
No files matched your search
+17
-9
@@ -33,18 +33,21 @@ CConfig::~CConfig()
|
||||
void CConfig::Load(const char *iniFileName)
|
||||
{
|
||||
iniFilename_ = iniFileName;
|
||||
NOTICE_LOG(LOADER, "Loading config: %s", iniFileName);
|
||||
INFO_LOG(LOADER, "Loading config: %s", iniFileName);
|
||||
bSaveSettings = true;
|
||||
|
||||
IniFile iniFile;
|
||||
iniFile.Load(iniFileName);
|
||||
if (!iniFile.Load(iniFileName)) {
|
||||
ERROR_LOG(LOADER, "Failed to read %s. Setting config to default.", iniFileName);
|
||||
// Continue anyway to initialize the config.
|
||||
}
|
||||
|
||||
IniFile::Section *general = iniFile.GetOrCreateSection("General");
|
||||
|
||||
bSpeedLimit = false;
|
||||
general->Get("FirstRun", &bFirstRun, true);
|
||||
general->Get("AutoLoadLast", &bAutoLoadLast, false);
|
||||
general->Get("AutoRun", &bAutoRun, false);
|
||||
general->Get("AutoRun", &bAutoRun, true);
|
||||
general->Get("ConfirmOnQuit", &bConfirmOnQuit, false);
|
||||
general->Get("IgnoreBadMemAccess", &bIgnoreBadMemAccess, true);
|
||||
general->Get("CurrentDirectory", ¤tDirectory, "");
|
||||
@@ -75,10 +78,12 @@ void CConfig::Load(const char *iniFileName)
|
||||
|
||||
void CConfig::Save()
|
||||
{
|
||||
if (g_Config.bSaveSettings && iniFilename_.size())
|
||||
{
|
||||
if (iniFilename_.size() && g_Config.bSaveSettings) {
|
||||
IniFile iniFile;
|
||||
iniFile.Load(iniFilename_.c_str());
|
||||
if (!iniFile.Load(iniFilename_.c_str())) {
|
||||
ERROR_LOG(LOADER, "Error saving config - can't read ini %s", iniFilename_.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
IniFile::Section *general = iniFile.GetOrCreateSection("General");
|
||||
general->Set("FirstRun", bFirstRun);
|
||||
@@ -107,9 +112,12 @@ void CConfig::Save()
|
||||
control->Set("ShowStick", bShowAnalogStick);
|
||||
control->Set("ShowTouchControls", bShowTouchControls);
|
||||
|
||||
iniFile.Save(iniFilename_.c_str());
|
||||
NOTICE_LOG(LOADER, "Config saved: %s", iniFilename_.c_str());
|
||||
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());
|
||||
} else {
|
||||
NOTICE_LOG(LOADER, "Error saving config: %s", iniFilename_.c_str());
|
||||
INFO_LOG(LOADER, "Not saving config");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user