summaryrefslogtreecommitdiffstats
path: root/src/Pad.h
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-06-02 10:25:55 +0200
committerGitHub <noreply@github.com>2019-06-02 10:25:55 +0200
commit9c26e46e17b421288f7653f4c9cff81b4b6cdfb0 (patch)
treec1b34122ddd4be0461a5310c964e8218b9f5781e /src/Pad.h
parentimplemented splashes; fixed zones (diff)
parentMerge branch 'master' into master (diff)
downloadre3-9c26e46e17b421288f7653f4c9cff81b4b6cdfb0.tar
re3-9c26e46e17b421288f7653f4c9cff81b4b6cdfb0.tar.gz
re3-9c26e46e17b421288f7653f4c9cff81b4b6cdfb0.tar.bz2
re3-9c26e46e17b421288f7653f4c9cff81b4b6cdfb0.tar.lz
re3-9c26e46e17b421288f7653f4c9cff81b4b6cdfb0.tar.xz
re3-9c26e46e17b421288f7653f4c9cff81b4b6cdfb0.tar.zst
re3-9c26e46e17b421288f7653f4c9cff81b4b6cdfb0.zip
Diffstat (limited to 'src/Pad.h')
-rw-r--r--src/Pad.h50
1 files changed, 47 insertions, 3 deletions
diff --git a/src/Pad.h b/src/Pad.h
index fee06f90..3d394498 100644
--- a/src/Pad.h
+++ b/src/Pad.h
@@ -73,12 +73,42 @@ public:
};
static_assert(sizeof(CControllerState) == 0x2A, "CControllerState: error");
-struct CMouseControllerState
+class CMouseControllerState
{
- uint32 btns; // bit 0-2 button 1-3
- int x, y;
+public:
+ //uint32 btns; // bit 0-2 button 1-3
+
+ UInt8 LMB;
+ UInt8 RMB;
+ UInt8 MMB;
+ UInt8 WHEELUP;
+ UInt8 WHEELDN;
+ UInt8 MXB1;
+ UInt8 MXB2;
+ UInt8 _pad0;
+
+ Float x, y;
+
+ CMouseControllerState();
+ void Clear();
+};
+
+VALIDATE_SIZE(CMouseControllerState, 0x10);
+
+class CMousePointerStateHelper
+{
+public:
+ Bool bInvertHorizontally;
+ Bool bInvertVertically;
+
+ CMouseControllerState GetMouseSetUp();
};
+VALIDATE_SIZE(CMousePointerStateHelper, 0x2);
+
+extern CMousePointerStateHelper &MousePointerStateHelper;
+
+
class CKeyboardState
{
public:
@@ -179,11 +209,25 @@ public:
bool GetLookLeft(void);
bool GetLookRight(void);
+ static void StopPadsShaking(void);
+ static void ResetCheats(void);
static void UpdatePads(void);
static CPad *GetPad(int n) { return &Pads[n]; }
static void PrintErrorMessage(void);
void AddToPCCheatString(Char c);
+ void Clear(Bool unk);
+
+ //
+
+ inline Bool GetLeftMouseJustDown() { return !!(NewMouseControllerState.LMB && !OldMouseControllerState.LMB); }
+
+ inline Bool GetEnterJustDown() { return !!(NewKeyState.ENTER && !OldKeyState.ENTER); }
+ inline Bool GetExtEnterJustDown() { return !!(NewKeyState.EXTENTER && !OldKeyState.EXTENTER); }
+ inline Bool GetCharJustDown(Char c) { return !!(NewKeyState.VK_KEYS[c] && !OldKeyState.VK_KEYS[c]); }
+ inline Bool GetLeftAltJustDown() { return !!(NewKeyState.LALT && !OldKeyState.LALT); }
+ inline Bool GetRightAltJustDown() { return !!(NewKeyState.RALT && !OldKeyState.RALT); }
+ inline Bool GetTabJustDown() { return !!(NewKeyState.TAB && !OldKeyState.TAB); }
};
static_assert(sizeof(CPad) == 0xFC, "CPad: error");