Merge pull request #803 from withmorten/master

add bInvertLook4Pad from VC
This commit is contained in:
erorcun 2020-11-16 02:36:47 +03:00 committed by GitHub
commit 1686eb9871
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 1 deletions

Binary file not shown.

View File

@ -15,6 +15,7 @@
#include "FileLoader.h" #include "FileLoader.h"
#include "Collision.h" #include "Collision.h"
#include "ModelInfo.h" #include "ModelInfo.h"
#include "Pad.h"
// Menu screens array is at the bottom of the file. // Menu screens array is at the bottom of the file.
@ -76,6 +77,12 @@
#define PIPELINES_SELECTOR #define PIPELINES_SELECTOR
#endif #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 *filterNames[] = { "FEM_NON", "FEM_SIM", "FEM_NRM", "FEM_MOB" };
const char *vehPipelineNames[] = { "FED_MFX", "FED_NEO" }; const char *vehPipelineNames[] = { "FED_MFX", "FED_NEO" };
const char *off_on[] = { "FEM_OFF", "FEM_ON" }; 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, { "FET_MTI", MENUPAGE_CONTROLLER_PC, MENUPAGE_CONTROLLER_PC, nil, nil,
MENUACTION_MOUSESENS, "FEC_MSH", { nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS }, MENUACTION_MOUSESENS, "FEC_MSH", { nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS },
MENUACTION_INVVERT, "FEC_IVV", { 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_MOUSESTEER, "FET_MST", { nil, SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS },
MENUACTION_CHANGEMENU, "FEDS_TB", { nil, SAVESLOT_NONE, MENUPAGE_NONE }, MENUACTION_CHANGEMENU, "FEDS_TB", { nil, SAVESLOT_NONE, MENUPAGE_NONE },
}, },

View File

@ -59,6 +59,9 @@ bool CPad::bDisplayNoControllerMessage;
bool CPad::bObsoleteControllerMessage; bool CPad::bObsoleteControllerMessage;
bool CPad::bOldDisplayNoControllerMessage; bool CPad::bOldDisplayNoControllerMessage;
bool CPad::m_bMapPadOneToPadTwo; bool CPad::m_bMapPadOneToPadTwo;
#ifdef INVERT_LOOK_FOR_PAD
bool CPad::bInvertLook4Pad;
#endif
#ifdef GTA_PS2 #ifdef GTA_PS2
unsigned char act_direct[6]; unsigned char act_direct[6];
unsigned char act_align[6]; unsigned char act_align[6];
@ -2534,10 +2537,20 @@ int16 CPad::SniperModeLookLeftRight(void)
int16 CPad::SniperModeLookUpDown(void) int16 CPad::SniperModeLookUpDown(void)
{ {
int16 axis = NewState.LeftStickY; int16 axis = NewState.LeftStickY;
int16 dpad;
#ifdef FIX_BUGS #ifdef FIX_BUGS
axis = -axis; axis = -axis;
#endif #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) ) if ( Abs(axis) > Abs(dpad) )
return axis; return axis;
@ -2567,6 +2580,10 @@ int16 CPad::LookAroundUpDown(void)
#ifdef FIX_BUGS #ifdef FIX_BUGS
axis = -axis; axis = -axis;
#endif #endif
#ifdef INVERT_LOOK_FOR_PAD
if (CPad::bInvertLook4Pad)
axis = -axis;
#endif
if ( Abs(axis) > 85 && !GetLookBehindForPed() ) if ( Abs(axis) > 85 && !GetLookBehindForPed() )
return (int16) ( (axis + ( ( axis > 0 ) ? -85 : 85) ) return (int16) ( (axis + ( ( axis > 0 ) ? -85 : 85) )

View File

@ -170,6 +170,9 @@ public:
static bool bObsoleteControllerMessage; static bool bObsoleteControllerMessage;
static bool bOldDisplayNoControllerMessage; static bool bOldDisplayNoControllerMessage;
static bool m_bMapPadOneToPadTwo; static bool m_bMapPadOneToPadTwo;
#ifdef INVERT_LOOK_FOR_PAD
static bool bInvertLook4Pad;
#endif
static CKeyboardState OldKeyState; static CKeyboardState OldKeyState;
static CKeyboardState NewKeyState; static CKeyboardState NewKeyState;

View File

@ -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 NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU
# define CUTSCENE_BORDERS_SWITCH # define CUTSCENE_BORDERS_SWITCH
# define MULTISAMPLING // adds MSAA option # define MULTISAMPLING // adds MSAA option
# define INVERT_LOOK_FOR_PAD // add bInvertLook4Pad from VC
# endif # endif
#endif #endif

View File

@ -8061,6 +8061,9 @@ PS2
[FEM_XBX] [FEM_XBX]
XBOX XBOX
[FEC_IVP]
INVERT PAD VERTICALLY
{ end of file } { end of file }
[DUMMY] [DUMMY]