summaryrefslogtreecommitdiffstats
path: root/src/ControllerConfig.h
blob: b7fd181ddff44d8d3092d6c25dddba2897565f5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#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 MakeControllerActionsBlank();
	void InitDefaultControlConfiguration();
	void InitDefaultControlConfigMouse(CMouseControllerState const &mousestate);
	
};

VALIDATE_SIZE(CControllerConfigManager, 0x143C);

extern CControllerConfigManager &ControlsManager;