summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author_AG <gennariarmando@outlook.com>2019-06-27 07:38:35 +0200
committer_AG <gennariarmando@outlook.com>2019-06-27 07:42:59 +0200
commit1ac41734465d28bdb2b641bc1b039e27c9b56786 (patch)
tree9b2ab26439b785de1f90c2ded146870436d11ac7
parentUpdate Wanted.cpp (diff)
downloadre3-1ac41734465d28bdb2b641bc1b039e27c9b56786.tar
re3-1ac41734465d28bdb2b641bc1b039e27c9b56786.tar.gz
re3-1ac41734465d28bdb2b641bc1b039e27c9b56786.tar.bz2
re3-1ac41734465d28bdb2b641bc1b039e27c9b56786.tar.lz
re3-1ac41734465d28bdb2b641bc1b039e27c9b56786.tar.xz
re3-1ac41734465d28bdb2b641bc1b039e27c9b56786.tar.zst
re3-1ac41734465d28bdb2b641bc1b039e27c9b56786.zip
-rw-r--r--src/Pad.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/Pad.cpp b/src/Pad.cpp
index 2e3f1c53..61b7ed06 100644
--- a/src/Pad.cpp
+++ b/src/Pad.cpp
@@ -1674,26 +1674,30 @@ int16 CPad::SniperModeLookUpDown(void)
int16 CPad::LookAroundLeftRight(void)
{
- int16 axis = NewState.RightStickX;
+ float axis = GetPad(0)->NewState.RightStickX;
- if ( fabs(axis) > 65 && !GetLookBehindForPed() )
- return ((axis > 0 ? axis - 65 : axis + 65) * ((255 - 65) / (127 - 32)));
+ if ( fabs(axis) > 85 && !GetLookBehindForPed() )
+ return (int16) ( (axis + ( axis > 0 ) ? -85 : 85)
+ * (127.0f / 32.0f) ); // 3.96875f
- else if (TheCamera.Cams[0].Using3rdPersonMouseCam() && fabs(axis) > 10)
- return (axis);
+ else if ( TheCamera.Cams[0].Using3rdPersonMouseCam() && fabs(axis) > 10 )
+ return (int16) ( (axis + ( axis > 0 ) ? -10 : 10)
+ * (127.0f / 64.0f) ); // 1.984375f
return 0;
}
int16 CPad::LookAroundUpDown(void)
{
- int16 axis = NewState.RightStickY;
+ int16 axis = GetPad(0)->NewState.RightStickY;
- if (fabs(axis) > 65 && !GetLookBehindForPed())
- return ((axis > 0 ? axis - 65 : axis + 65) * ((255 - 65) / (127 - 32)));
+ if ( abs(axis) > 85 && !GetLookBehindForPed() )
+ return (int16) ( (axis + ( axis > 0 ) ? -85 : 85)
+ * (127.0f / 32.0f) ); // 3.96875f
- else if (TheCamera.Cams[0].Using3rdPersonMouseCam() && fabs(axis) > 10)
- return (axis);
+ else if ( TheCamera.Cams[0].Using3rdPersonMouseCam() && abs(axis) > 40 )
+ return (int16) ( (axis + ( axis > 0 ) ? -40 : 40)
+ * (127.0f / 64.0f) ); // 1.984375f
return 0;
}