summaryrefslogtreecommitdiffstats
path: root/src/core/Pad.h
diff options
context:
space:
mode:
authorFire_Head <Fire-Head@users.noreply.github.com>2019-07-24 20:00:08 +0200
committerGitHub <noreply@github.com>2019-07-24 20:00:08 +0200
commit81ee1c509a8d05189901dd59c268bf47a6188eb8 (patch)
treed836f70678f2ce7b5d86a6745f34b45232ff71d0 /src/core/Pad.h
parentupdate (diff)
parentMerge branch 'master' into master (diff)
downloadre3-81ee1c509a8d05189901dd59c268bf47a6188eb8.tar
re3-81ee1c509a8d05189901dd59c268bf47a6188eb8.tar.gz
re3-81ee1c509a8d05189901dd59c268bf47a6188eb8.tar.bz2
re3-81ee1c509a8d05189901dd59c268bf47a6188eb8.tar.lz
re3-81ee1c509a8d05189901dd59c268bf47a6188eb8.tar.xz
re3-81ee1c509a8d05189901dd59c268bf47a6188eb8.tar.zst
re3-81ee1c509a8d05189901dd59c268bf47a6188eb8.zip
Diffstat (limited to 'src/core/Pad.h')
-rw-r--r--src/core/Pad.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/core/Pad.h b/src/core/Pad.h
index 62585377..4f129e85 100644
--- a/src/core/Pad.h
+++ b/src/core/Pad.h
@@ -51,6 +51,17 @@ enum Key
};
*/
+enum {
+ PLAYERCONTROL_ENABLED = 0,
+ PLAYERCONTROL_DISABLED_1 = 1,
+ PLAYERCONTROL_DISABLED_2 = 2,
+ PLAYERCONTROL_DISABLED_4 = 4,
+ PLAYERCONTROL_DISABLED_8 = 8,
+ PLAYERCONTROL_DISABLED_10 = 16,
+ PLAYERCONTROL_DISABLED_20 = 32,
+ PLAYERCONTROL_DISABLED_40 = 64, // used on phone calls
+ PLAYERCONTROL_DISABLED_80 = 128,
+};
class CControllerState
{
@@ -186,9 +197,9 @@ public:
int16 Mode;
int16 ShakeDur;
uint8 ShakeFreq;
- int8 bHornHistory[5];
+ bool bHornHistory[5];
uint8 iCurrHornHistory;
- bool DisablePlayerControls;
+ uint8 DisablePlayerControls;
int8 bApplyBrakes;
char _unk[12]; //int32 unk[3];
char _pad0[3];
@@ -289,6 +300,10 @@ public:
// mouse
bool GetLeftMouseJustDown() { return !!(NewMouseControllerState.LMB && !OldMouseControllerState.LMB); }
+ bool GetRightMouseJustDown() { return !!(NewMouseControllerState.RMB && !OldMouseControllerState.RMB); }
+ bool GetMiddleMouseJustDown() { return !!(NewMouseControllerState.MMB && !OldMouseControllerState.MMB); }
+ float GetMouseX() { return NewMouseControllerState.x; }
+ float GetMouseY() { return NewMouseControllerState.y; }
// keyboard
@@ -354,6 +369,13 @@ public:
bool GetRightShoulder1JustDown() { return !!(NewState.RightShoulder1 && !OldState.RightShoulder1); }
bool GetRightShoulder2JustDown() { return !!(NewState.RightShoulder2 && !OldState.RightShoulder2); }
+/*
+ int32 GetLeftShoulder1(void) { return NewState.LeftShoulder1; }
+ int32 GetLeftShoulder2(void) { return NewState.LeftShoulder2; }
+ int32 GetRightShoulder1(void) { return NewState.RightShoulder1; }
+ int32 GetRightShoulder2(void) { return NewState.RightShoulder2; }
+*/
+
bool GetTriangle() { return !!NewState.Triangle; }
bool GetCircle() { return !!NewState.Circle; }
bool GetCross() { return !!NewState.Cross; }
@@ -366,10 +388,11 @@ public:
bool GetLeftShoulder2(void) { return !!NewState.LeftShoulder2; }
bool GetRightShoulder1(void) { return !!NewState.RightShoulder1; }
bool GetRightShoulder2(void) { return !!NewState.RightShoulder2; }
+
+ bool ArePlayerControlsDisabled(void) { return DisablePlayerControls != PLAYERCONTROL_ENABLED; }
};
VALIDATE_SIZE(CPad, 0xFC);
+extern CPad *Pads; //[2]
#define IsButtonJustDown(pad, btn) \
(!(pad)->OldState.btn && (pad)->NewState.btn)
-
-void LittleTest(void);