summaryrefslogtreecommitdiffstats
path: root/src/core/ControllerConfig.h
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-07-07 13:09:11 +0200
committeraap <aap@papnet.eu>2019-07-07 13:09:11 +0200
commit53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb (patch)
treefc65a6c40fa719f9d43be9e0e15be79c490135e0 /src/core/ControllerConfig.h
parentfinished CPhysical (diff)
downloadre3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar
re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.gz
re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.bz2
re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.lz
re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.xz
re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.tar.zst
re3-53023eb65bdcde43e341c1ecb7cf0c7f8ee524fb.zip
Diffstat (limited to 'src/core/ControllerConfig.h')
-rw-r--r--src/core/ControllerConfig.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/core/ControllerConfig.h b/src/core/ControllerConfig.h
new file mode 100644
index 00000000..581efe05
--- /dev/null
+++ b/src/core/ControllerConfig.h
@@ -0,0 +1,58 @@
+#pragma once
+
+
+// based on x-gtasa
+
+enum eControllerType
+{
+ KEYBOARD,
+ OPTIONAL_EXTRA,
+ MOUSE,
+ JOYSTICK,
+};
+
+class CMouseControllerState;
+
+class CControllerConfigManager
+{
+public:
+ struct tControllerConfigBind
+ {
+ RsKeyCodes m_Key;
+ int32 m_ContSetOrder;
+ };
+
+ bool field_0;
+ char _pad0[3];
+ DIJOYSTATE2 m_OldState;
+ DIJOYSTATE2 m_NewState;
+ wchar m_aActionNames[41][40];
+ bool m_aButtonStates[17];
+ char _pad1[3];
+ tControllerConfigBind m_aSettings[41][4];
+ uint8 m_aSimCheckers[4][4];
+ bool m_bMouseAssociated;
+ char _pad2[3];
+
+ void UpdateJoyButtonState(int padnumber);
+ void UpdateJoyInConfigMenus_ButtonDown(int button, int padnumber);
+ void AffectControllerStateOn_ButtonDown(int button, eControllerType type);
+ void UpdateJoyInConfigMenus_ButtonUp(int button, int padnumber);
+ void AffectControllerStateOn_ButtonUp(int button, int padnumber);
+
+ int32 GetJoyButtonJustDown();
+ void LoadSettings(int32 file);
+ void SaveSettings(int32 file);
+ void MakeControllerActionsBlank();
+ void InitDefaultControlConfiguration();
+ void InitDefaultControlConfigMouse(CMouseControllerState const &mousestate);
+ void InitDefaultControlConfigJoyPad(unsigned int buttons);
+ void ClearSimButtonPressCheckers();
+ void AffectPadFromKeyBoard();
+ void AffectPadFromMouse();
+
+};
+
+VALIDATE_SIZE(CControllerConfigManager, 0x143C);
+
+extern CControllerConfigManager &ControlsManager; \ No newline at end of file