summaryrefslogtreecommitdiffstats
path: root/src/core/Pad.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-02-03 20:43:25 +0100
committerGitHub <noreply@github.com>2021-02-03 20:43:25 +0100
commit91c3bdfa15188054295e04b5152aa9169c38ce07 (patch)
treecccd13a63bfda33ac24af29ce7a6a15f880dd59d /src/core/Pad.cpp
parentand a space (diff)
parentAdd undef (diff)
downloadre3-91c3bdfa15188054295e04b5152aa9169c38ce07.tar
re3-91c3bdfa15188054295e04b5152aa9169c38ce07.tar.gz
re3-91c3bdfa15188054295e04b5152aa9169c38ce07.tar.bz2
re3-91c3bdfa15188054295e04b5152aa9169c38ce07.tar.lz
re3-91c3bdfa15188054295e04b5152aa9169c38ce07.tar.xz
re3-91c3bdfa15188054295e04b5152aa9169c38ce07.tar.zst
re3-91c3bdfa15188054295e04b5152aa9169c38ce07.zip
Diffstat (limited to 'src/core/Pad.cpp')
-rw-r--r--src/core/Pad.cpp116
1 files changed, 116 insertions, 0 deletions
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 95a107ee..9bcac613 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -2336,6 +2336,121 @@ bool CPad::ShiftTargetRightJustDown(void)
return !!(NewState.RightShoulder2 && !OldState.RightShoulder2);
}
+#ifdef FIX_BUGS
+// FIX: fixes from VC for the bug of double switching the controller setup
+bool CPad::GetAnaloguePadUp(void)
+{
+ static int16 oldfStickY = 0;
+
+ int16 leftStickY = CPad::GetPad(0)->GetLeftStickY();
+
+ if ( leftStickY < -15 && oldfStickY >= -5 )
+ {
+ oldfStickY = leftStickY;
+ return true;
+ }
+ else
+ {
+ oldfStickY = leftStickY;
+ return false;
+ }
+}
+
+bool CPad::GetAnaloguePadDown(void)
+{
+ static int16 oldfStickY = 0;
+
+ int16 leftStickY = CPad::GetPad(0)->GetLeftStickY();
+
+ if ( leftStickY > 15 && oldfStickY <= 5 )
+ {
+ oldfStickY = leftStickY;
+ return true;
+ }
+ else
+ {
+ oldfStickY = leftStickY;
+ return false;
+ }
+}
+
+bool CPad::GetAnaloguePadLeft(void)
+{
+ static int16 oldfStickX = 0;
+
+ int16 leftStickX = CPad::GetPad(0)->GetLeftStickX();
+
+ if ( leftStickX < -15 && oldfStickX >= -5 )
+ {
+ oldfStickX = leftStickX;
+ return true;
+ }
+ else
+ {
+ oldfStickX = leftStickX;
+ return false;
+ }
+}
+
+bool CPad::GetAnaloguePadRight(void)
+{
+ static int16 oldfStickX = 0;
+
+ int16 leftStickX = CPad::GetPad(0)->GetLeftStickX();
+
+ if ( leftStickX > 15 && oldfStickX <= 5 )
+ {
+ oldfStickX = leftStickX;
+ return true;
+ }
+ else
+ {
+ oldfStickX = leftStickX;
+ return false;
+ }
+}
+
+bool CPad::GetAnaloguePadLeftJustUp(void)
+{
+ static int16 oldfStickX = 0;
+
+ int16 X = GetPad(0)->GetPedWalkLeftRight();
+
+ if ( X == 0 && oldfStickX < 0 )
+ {
+ oldfStickX = 0;
+
+ return true;
+ }
+ else
+ {
+ oldfStickX = X;
+
+ return false;
+ }
+}
+
+bool CPad::GetAnaloguePadRightJustUp(void)
+{
+ static int16 oldfStickX = 0;
+
+ int16 X = GetPad(0)->GetPedWalkLeftRight();
+
+ if ( X == 0 && oldfStickX > 0 )
+ {
+ oldfStickX = 0;
+
+ return true;
+ }
+ else
+ {
+ oldfStickX = X;
+
+ return false;
+ }
+}
+
+#else
bool CPad::GetAnaloguePadUp(void)
{
static int16 oldfStickY = 0;
@@ -2447,6 +2562,7 @@ bool CPad::GetAnaloguePadRightJustUp(void)
return false;
}
}
+#endif
bool CPad::ForceCameraBehindPlayer(void)
{