From 8425a23585063ff61481a8b805d8e32146be325d Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sat, 27 Mar 2021 03:08:22 +0100 Subject: [PATCH] :recycle: Only write ini file once --- 3rdParty/Storm/Source/storm.h | 1 + Source/diablo.cpp | 2 ++ SourceX/storm/storm.cpp | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/3rdParty/Storm/Source/storm.h b/3rdParty/Storm/Source/storm.h index 291a6f43c..2171d6c56 100644 --- a/3rdParty/Storm/Source/storm.h +++ b/3rdParty/Storm/Source/storm.h @@ -285,6 +285,7 @@ BOOL bool getIniBool(const char *sectionName, const char *keyName, bool defaultValue = false); bool getIniValue(const char *sectionName, const char *keyName, char *string, int stringSize, const char *defaultString = ""); void setIniValue(const char *sectionName, const char *keyName, const char *value, int len = 0); +void SaveIni(); int getIniInt(const char *keyname, const char *valuename, int defaultValue); void setIniInt(const char *keyname, const char *valuename, int value); diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 535386822..2ac7378a9 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -458,6 +458,8 @@ static void SaveOptions() #ifdef __vita__ setIniInt("Controller", "Enable Rear Touchpad", sgOptions.Controller.bRearTouch); #endif + + SaveIni(); } /** diff --git a/SourceX/storm/storm.cpp b/SourceX/storm/storm.cpp index fe3a2e668..59dda01a9 100644 --- a/SourceX/storm/storm.cpp +++ b/SourceX/storm/storm.cpp @@ -305,8 +305,11 @@ void setIniValue(const char *sectionName, const char *keyName, const char *value } else { key->setValue(stringValue); } +} - ini.saveToFile(); +void SaveIni() +{ + getIni().saveToFile(); } int getIniInt(const char *keyname, const char *valuename, int defaultValue)