summaryrefslogtreecommitdiffstats
path: root/src/core/Pad.cpp
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2020-11-16 00:36:47 +0100
committerGitHub <noreply@github.com>2020-11-16 00:36:47 +0100
commit1686eb98719ed06d4f146c9eebf1ba91a7cb80a2 (patch)
treeec077d93f1d1c315b8a5611d1f0355afb979be49 /src/core/Pad.cpp
parentMake collision code placement more like original (+ small fixes) (diff)
parentmove config.h define to CUSTOM_FRONTEND_OPTIONS (diff)
downloadre3-1686eb98719ed06d4f146c9eebf1ba91a7cb80a2.tar
re3-1686eb98719ed06d4f146c9eebf1ba91a7cb80a2.tar.gz
re3-1686eb98719ed06d4f146c9eebf1ba91a7cb80a2.tar.bz2
re3-1686eb98719ed06d4f146c9eebf1ba91a7cb80a2.tar.lz
re3-1686eb98719ed06d4f146c9eebf1ba91a7cb80a2.tar.xz
re3-1686eb98719ed06d4f146c9eebf1ba91a7cb80a2.tar.zst
re3-1686eb98719ed06d4f146c9eebf1ba91a7cb80a2.zip
Diffstat (limited to 'src/core/Pad.cpp')
-rw-r--r--src/core/Pad.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 928ae826..44a347bd 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -59,6 +59,9 @@ bool CPad::bDisplayNoControllerMessage;
bool CPad::bObsoleteControllerMessage;
bool CPad::bOldDisplayNoControllerMessage;
bool CPad::m_bMapPadOneToPadTwo;
+#ifdef INVERT_LOOK_FOR_PAD
+bool CPad::bInvertLook4Pad;
+#endif
#ifdef GTA_PS2
unsigned char act_direct[6];
unsigned char act_align[6];
@@ -2534,10 +2537,20 @@ int16 CPad::SniperModeLookLeftRight(void)
int16 CPad::SniperModeLookUpDown(void)
{
int16 axis = NewState.LeftStickY;
+ int16 dpad;
#ifdef FIX_BUGS
axis = -axis;
#endif
- int16 dpad = (NewState.DPadUp - NewState.DPadDown) / 2;
+#ifndef INVERT_LOOK_FOR_PAD
+ dpad = (NewState.DPadUp - NewState.DPadDown) / 2;
+#else
+ if (CPad::bInvertLook4Pad) {
+ axis = -axis;
+ dpad = (NewState.DPadDown - NewState.DPadUp) / 2;
+ } else {
+ dpad = (NewState.DPadUp - NewState.DPadDown) / 2;
+ }
+#endif
if ( Abs(axis) > Abs(dpad) )
return axis;
@@ -2567,6 +2580,10 @@ int16 CPad::LookAroundUpDown(void)
#ifdef FIX_BUGS
axis = -axis;
#endif
+#ifdef INVERT_LOOK_FOR_PAD
+ if (CPad::bInvertLook4Pad)
+ axis = -axis;
+#endif
if ( Abs(axis) > 85 && !GetLookBehindForPed() )
return (int16) ( (axis + ( ( axis > 0 ) ? -85 : 85) )