summaryrefslogtreecommitdiffstats
path: root/src/skel/win/win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/skel/win/win.cpp')
-rw-r--r--src/skel/win/win.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp
index 2cf7ed37..87c3846a 100644
--- a/src/skel/win/win.cpp
+++ b/src/skel/win/win.cpp
@@ -2145,8 +2145,15 @@ WinMain(HINSTANCE instance,
{
CFileMgr::SetDirMyDocuments();
+#ifdef LOAD_INI_SETTINGS
+ // At this point InitDefaultControlConfigJoyPad must have set all bindings to default and ms_padButtonsInited to number of detected buttons.
+ // We will load stored bindings below, but let's cache ms_padButtonsInited before LoadINIControllerSettings and LoadSettings clears it,
+ // so we can add new joy bindings **on top of** stored bindings.
+ int connectedPadButtons = ControlsManager.ms_padButtonsInited;
+#endif
+
int32 gta3set = CFileMgr::OpenFile("gta_vc.set", "r");
-
+
if ( gta3set )
{
ControlsManager.LoadSettings(gta3set);
@@ -2154,6 +2161,14 @@ WinMain(HINSTANCE instance,
}
CFileMgr::SetDir("");
+
+#ifdef LOAD_INI_SETTINGS
+ LoadINIControllerSettings();
+ if (connectedPadButtons != 0) {
+ ControlsManager.InitDefaultControlConfigJoyPad(connectedPadButtons);
+ SaveINIControllerSettings();
+ }
+#endif
}
SetErrorMode(SEM_FAILCRITICALERRORS);