summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2020-11-16 02:36:47 +0300
committerGitHub <noreply@github.com>2020-11-16 02:36:47 +0300
commit1686eb98719ed06d4f146c9eebf1ba91a7cb80a2 (patch)
treeec077d93f1d1c315b8a5611d1f0355afb979be49
parenta6f5f4634c63a515196a0f650682953356cb8e18 (diff)
parent207f8576d83c54d80a05a983798ce1d4bcb34f91 (diff)
Merge pull request #803 from withmorten/master
add bInvertLook4Pad from VC
-rw-r--r--gamefiles/TEXT/american.gxtbin220024 -> 220080 bytes
-rw-r--r--src/core/MenuScreensCustom.cpp8
-rw-r--r--src/core/Pad.cpp19
-rw-r--r--src/core/Pad.h3
-rw-r--r--src/core/config.h1
-rw-r--r--utils/gxt/american.txt3
6 files changed, 33 insertions, 1 deletions
diff --git a/gamefiles/TEXT/american.gxt b/gamefiles/TEXT/american.gxt
index e7f714b2..1054ca12 100644
--- a/gamefiles/TEXT/american.gxt
+++ b/gamefiles/TEXT/american.gxt
Binary files differ
diff --git a/src/core/MenuScreensCustom.cpp b/src/core/MenuScreensCustom.cpp
index d3d7474d..f8ff3acf 100644
--- a/src/core/MenuScreensCustom.cpp
+++ b/src/core/MenuScreensCustom.cpp
@@ -15,6 +15,7 @@
#include "FileLoader.h"
#include "Collision.h"
#include "ModelInfo.h"
+#include "Pad.h"
// Menu screens array is at the bottom of the file.
@@ -76,6 +77,12 @@
#define PIPELINES_SELECTOR
#endif
+#ifdef INVERT_LOOK_FOR_PAD
+ #define INVERT_PAD_SELECTOR MENUACTION_CFO_SELECT, "FEC_IVP", { new CCFOSelect((int8*)&CPad::bInvertLook4Pad, "InvertPad", off_on, 2, false, nil) },
+#else
+ #define INVERT_PAD_SELECTOR
+#endif
+
const char *filterNames[] = { "FEM_NON", "FEM_SIM", "FEM_NRM", "FEM_MOB" };
const char *vehPipelineNames[] = { "FED_MFX", "FED_NEO" };
const char *off_on[] = { "FEM_OFF", "FEM_ON" };
@@ -780,6 +787,7 @@ CMenuScreenCustom aScreens[MENUPAGES] = {
{ "FET_MTI", MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, nil, nil,
MENUACTION_MOUSESENS, "FEC_MSH", { nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS },
MENUACTION_INVVERT, "FEC_IVV", { nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS },
+ INVERT_PAD_SELECTOR
MENUACTION_MOUSESTEER, "FET_MST", { nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS },
MENUACTION_CHANGEMENU, "FEDS_TB", { nil, SAVESLOT_NONE, MENUPAGE_NONE },
},
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) )
diff --git a/src/core/Pad.h b/src/core/Pad.h
index 8c5d7ba3..20a676ef 100644
--- a/src/core/Pad.h
+++ b/src/core/Pad.h
@@ -170,6 +170,9 @@ public:
static bool bObsoleteControllerMessage;
static bool bOldDisplayNoControllerMessage;
static bool m_bMapPadOneToPadTwo;
+#ifdef INVERT_LOOK_FOR_PAD
+ static bool bInvertLook4Pad;
+#endif
static CKeyboardState OldKeyState;
static CKeyboardState NewKeyState;
diff --git a/src/core/config.h b/src/core/config.h
index a55b018e..1d321175 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -275,6 +275,7 @@ enum Config {
# define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
# define CUTSCENE_BORDERS_SWITCH
# define MULTISAMPLING // adds MSAA option
+# define INVERT_LOOK_FOR_PAD // add bInvertLook4Pad from VC
# endif
#endif
diff --git a/utils/gxt/american.txt b/utils/gxt/american.txt
index c428a570..cdee16f9 100644
--- a/utils/gxt/american.txt
+++ b/utils/gxt/american.txt
@@ -8061,6 +8061,9 @@ PS2
[FEM_XBX]
XBOX
+[FEC_IVP]
+INVERT PAD VERTICALLY
+
{ end of file }
[DUMMY]