Skip to content

Commit

Permalink
Fix premature .ini saving leading to missing bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
erorcun committed Aug 15, 2021
1 parent df89e50 commit 747ae04
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
3 changes: 0 additions & 3 deletions src/core/Frontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3812,9 +3812,6 @@ CMenuManager::LoadSettings()
if (LoadINISettings()) {
LoadINIControllerSettings();
}
// if no re3.ini, create it, or update it with new values
SaveINISettings();
SaveINIControllerSettings();
#endif

m_PrefsVsync = m_PrefsVsyncDisp;
Expand Down
10 changes: 6 additions & 4 deletions src/skel/glfw/glfw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1935,10 +1935,12 @@ main(int argc, char *argv[])

#ifdef LOAD_INI_SETTINGS
LoadINIControllerSettings();
if (connectedPadButtons != 0) {
ControlsManager.InitDefaultControlConfigJoyPad(connectedPadButtons);
SaveINIControllerSettings();
}
if (connectedPadButtons != 0)
ControlsManager.InitDefaultControlConfigJoyPad(connectedPadButtons); // add (connected-saved) amount of new button assignments on top of ours

// these have 2 purposes: creating .ini at the start, and adding newly introduced settings to old .ini at the start
SaveINISettings();
SaveINIControllerSettings();
#endif
}

Expand Down
10 changes: 6 additions & 4 deletions src/skel/win/win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2181,10 +2181,12 @@ WinMain(HINSTANCE instance,

#ifdef LOAD_INI_SETTINGS
LoadINIControllerSettings();
if (connectedPadButtons != 0) {
ControlsManager.InitDefaultControlConfigJoyPad(connectedPadButtons);
SaveINIControllerSettings();
}
if (connectedPadButtons != 0)
ControlsManager.InitDefaultControlConfigJoyPad(connectedPadButtons); // add (connected-saved) amount of new button assignments on top of ours

// these have 2 purposes: creating .ini at the start, and adding newly introduced settings to old .ini at the start
SaveINISettings();
SaveINIControllerSettings();
#endif
}

Expand Down

0 comments on commit 747ae04

Please sign in to comment.