summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-12-21 20:48:28 +0100
committeraap <aap@papnet.eu>2020-12-21 20:48:28 +0100
commit88b0134e72077b89c172fe857bf8a2735cb47cf3 (patch)
treea7282da87b98d33390991219bce4e18a671f83a2 /src
parentfix sizeof (diff)
downloadre3-88b0134e72077b89c172fe857bf8a2735cb47cf3.tar
re3-88b0134e72077b89c172fe857bf8a2735cb47cf3.tar.gz
re3-88b0134e72077b89c172fe857bf8a2735cb47cf3.tar.bz2
re3-88b0134e72077b89c172fe857bf8a2735cb47cf3.tar.lz
re3-88b0134e72077b89c172fe857bf8a2735cb47cf3.tar.xz
re3-88b0134e72077b89c172fe857bf8a2735cb47cf3.tar.zst
re3-88b0134e72077b89c172fe857bf8a2735cb47cf3.zip
Diffstat (limited to 'src')
-rw-r--r--src/animation/AnimManager.cpp8
-rw-r--r--src/animation/AnimManager.h2
-rw-r--r--src/core/Cam.cpp4
-rw-r--r--src/core/Camera.cpp4
-rw-r--r--src/core/Frontend.cpp6
-rw-r--r--src/core/MenuScreens.cpp2
-rw-r--r--src/core/MenuScreensCustom.cpp2
-rw-r--r--src/core/config.h1
-rw-r--r--src/peds/PlayerPed.cpp5
9 files changed, 31 insertions, 3 deletions
diff --git a/src/animation/AnimManager.cpp b/src/animation/AnimManager.cpp
index edb7f877..9fc54654 100644
--- a/src/animation/AnimManager.cpp
+++ b/src/animation/AnimManager.cpp
@@ -287,6 +287,7 @@ AnimAssocDesc aStripAnimDescs[] = {
{ ANIM_STRIP_F, ASSOC_REPEAT | ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_STRIP_G, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
};
+#ifdef PC_PLAYER_CONTROLS
AnimAssocDesc aStdAnimDescsSide[] = {
{ ANIM_WALK, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_WALK },
{ ANIM_RUN, ASSOC_REPEAT | ASSOC_MOVEMENT | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION | ASSOC_WALK },
@@ -294,7 +295,7 @@ AnimAssocDesc aStdAnimDescsSide[] = {
{ ANIM_IDLE_STANCE, ASSOC_REPEAT },
{ ANIM_WALK_START, ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION },
};
-
+#endif
char const* aStdAnimations[] = {
"walk_civi",
"run_civi",
@@ -834,6 +835,7 @@ char const* aSkateAnimations[] = {
"skate_sprint",
"skate_idle",
};
+#ifdef PC_PLAYER_CONTROLS
char const* aPlayerStrafeBackAnimations[] = {
"walk_back",
"run_back",
@@ -897,7 +899,7 @@ char const* aChainsawStrafeRightAnimations[] = {
"idle_csaw",
"walkst_csaw_right",
};
-
+#endif
#define awc(a) ARRAY_SIZE(a), a
const AnimAssocDefinition CAnimManager::ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_GROUPS] = {
@@ -953,6 +955,7 @@ const AnimAssocDefinition CAnimManager::ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_
{ "jogwoman", "ped", MI_COP, awc(aJoggerWomanAnimations), aStdAnimDescs },
{ "panicchunky", "ped", MI_COP, awc(aPanicChunkyAnimations), aStdAnimDescs },
{ "skate", "skate", MI_COP, awc(aSkateAnimations), aStdAnimDescs },
+#ifdef PC_PLAYER_CONTROLS
{ "playerback", "ped", MI_COP, awc(aPlayerStrafeBackAnimations), aStdAnimDescs },
{ "playerleft", "ped", MI_COP, awc(aPlayerStrafeLeftAnimations), aStdAnimDescsSide },
{ "playerright", "ped", MI_COP, awc(aPlayerStrafeRightAnimations), aStdAnimDescsSide },
@@ -962,6 +965,7 @@ const AnimAssocDefinition CAnimManager::ms_aAnimAssocDefinitions[NUM_ANIM_ASSOC_
{ "csawback", "ped", MI_COP, awc(aChainsawStrafeBackAnimations), aStdAnimDescs },
{ "csawleft", "ped", MI_COP, awc(aChainsawStrafeLeftAnimations), aStdAnimDescsSide },
{ "csawright", "ped", MI_COP, awc(aChainsawStrafeRightAnimations), aStdAnimDescsSide },
+#endif
};
#undef awc
diff --git a/src/animation/AnimManager.h b/src/animation/AnimManager.h
index 8333b865..213326b6 100644
--- a/src/animation/AnimManager.h
+++ b/src/animation/AnimManager.h
@@ -57,6 +57,7 @@ enum AssocGroupId
ASSOCGRP_JOGWOMAN,
ASSOCGRP_PANICCHUNKY,
ASSOCGRP_SKATE,
+#ifdef PC_PLAYER_CONTROLS
ASSOCGRP_PLAYERBACK,
ASSOCGRP_PLAYERLEFT,
ASSOCGRP_PLAYERRIGHT,
@@ -66,6 +67,7 @@ enum AssocGroupId
ASSOCGRP_CHAINSAWBACK,
ASSOCGRP_CHAINSAWLEFT,
ASSOCGRP_CHAINSAWRIGHT,
+#endif
NUM_ANIM_ASSOC_GROUPS
};
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index 9b4715b2..2cf1748c 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -180,9 +180,11 @@ CCam::Process(void)
Process_BehindCar(CameraTarget, TargetOrientation, SpeedVar, TargetSpeedVar);
break;
case MODE_FOLLOWPED:
+#ifdef PC_PLAYER_CONTROLS
if(CCamera::m_bUseMouse3rdPerson)
Process_FollowPedWithMouse(CameraTarget, TargetOrientation, SpeedVar, TargetSpeedVar);
else
+#endif
#ifdef FREE_CAM
if(CCamera::bFreeCam)
Process_FollowPed_Rotation(CameraTarget, TargetOrientation, SpeedVar, TargetSpeedVar);
@@ -3735,6 +3737,7 @@ CCam::Process_Fixed(const CVector &CameraTarget, float, float, float)
}
}
+#ifdef PC_PLAYER_CONTROLS
if(FrontEndMenuManager.m_ControlMethod == CONTROL_STANDARD && Using3rdPersonMouseCam()){
CPed *player = FindPlayerPed();
if(player && player->CanStrafeOrMouseControl()){
@@ -3745,6 +3748,7 @@ CCam::Process_Fixed(const CVector &CameraTarget, float, float, float)
TheCamera.pTargetEntity->GetMatrix().UpdateRW();
}
}
+#endif
}
void
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index 531c3417..e11410e2 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -69,7 +69,11 @@ enum
// NB: removed explicit TheCamera from all functions
CCamera TheCamera;
+#ifdef PC_PLAYER_CONTROLS
bool CCamera::m_bUseMouse3rdPerson = true;
+#else
+bool CCamera::m_bUseMouse3rdPerson = false;
+#endif
bool bDidWeProcessAnyCinemaCam;
static bool bSwitchedToObbeCam;
float CCamera::m_fMouseAccelHorzntl;
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 18554a4d..b16f511b 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -493,7 +493,11 @@ CMenuManager::CMenuManager()
m_PrefsDMA = 1;
OS_Language = LANG_ENGLISH;
m_ControlMethod = CONTROL_STANDARD;
+#ifdef PC_PLAYER_CONTROLS
CCamera::m_bUseMouse3rdPerson = true;
+#else
+ CCamera::m_bUseMouse3rdPerson = false;
+#endif
m_lastWorking3DAudioProvider = 0;
m_nFirstVisibleRowOnList = 0;
m_nScrollbarTopMargin = 0.0f;
@@ -3019,7 +3023,9 @@ CMenuManager::LoadSettings()
CFileMgr::CloseFile(fileHandle);
CFileMgr::SetDir("");
+#ifdef PC_PLAYER_CONTROLS
CCamera::m_bUseMouse3rdPerson = m_ControlMethod == CONTROL_STANDARD;
+#endif
#ifdef LEGACY_MENU_OPTIONS
m_PrefsVsync = m_PrefsVsyncDisp;
#endif
diff --git a/src/core/MenuScreens.cpp b/src/core/MenuScreens.cpp
index d4d028c9..173de805 100644
--- a/src/core/MenuScreens.cpp
+++ b/src/core/MenuScreens.cpp
@@ -215,7 +215,9 @@ CMenuScreen aScreens[] = {
// MENUPAGE_CONTROLLER_PC = 26
{ "FET_CTL", MENUPAGE_OPTIONS, 0,
+#ifdef PC_PLAYER_CONTROLS
MENUACTION_CTRLMETHOD, "FET_STI", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC, 320, 150, MENUALIGN_CENTER,
+#endif
MENUACTION_KEYBOARDCTRLS,"FEC_RED", SAVESLOT_NONE, MENUPAGE_KEYBOARD_CONTROLS, 0, 0, MENUALIGN_CENTER,
MENUACTION_CHANGEMENU, "FEC_MOU", SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS, 0, 0, MENUALIGN_CENTER,
MENUACTION_RESTOREDEF, "FET_DEF", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC, 0, 0, MENUALIGN_CENTER,
diff --git a/src/core/MenuScreensCustom.cpp b/src/core/MenuScreensCustom.cpp
index c14f938b..e35a7751 100644
--- a/src/core/MenuScreensCustom.cpp
+++ b/src/core/MenuScreensCustom.cpp
@@ -566,7 +566,9 @@ CMenuScreenCustom aScreens[] = {
// MENUPAGE_CONTROLLER_PC = 26
{ "FET_CTL", MENUPAGE_OPTIONS, new CCustomScreenLayout({0, 0, MENU_DEFAULT_LINE_HEIGHT, false, false, 150}), nil,
+#ifdef PC_PLAYER_CONTROLS
MENUACTION_CTRLMETHOD, "FET_STI", {nil, SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC}, 320, 150, MENUALIGN_CENTER,
+#endif
MENUACTION_KEYBOARDCTRLS,"FEC_RED", {nil, SAVESLOT_NONE, MENUPAGE_KEYBOARD_CONTROLS}, 0, 0, MENUALIGN_CENTER,
#ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS
MENUACTION_CHANGEMENU, "FEC_JOD", {nil, SAVESLOT_NONE, MENUPAGE_DETECT_JOYSTICK}, 0, 0, MENUALIGN_CENTER,
diff --git a/src/core/config.h b/src/core/config.h
index 7742999f..ae2189e2 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -208,6 +208,7 @@ enum Config {
# define RANDOMSPLASH // use random splash as on PS2
# define PS2_MATFX
# endif
+# define PC_PLAYER_CONTROLS // mouse player/cam mode
# define GTA_REPLAY
# define GTA_SCENE_EDIT
#elif defined GTA_XBOX
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index 7d11f77e..c84ed4b4 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -1159,6 +1159,7 @@ void
CPlayerPed::ProcessAnimGroups(void)
{
AssocGroupId groupToSet;
+#ifdef PC_PLAYER_CONTROLS
if ((m_fWalkAngle <= -DEGTORAD(50.0f) || m_fWalkAngle >= DEGTORAD(50.0f))
&& TheCamera.Cams[TheCamera.ActiveCam].Using3rdPersonMouseCam()
&& CanStrafeOrMouseControl()) {
@@ -1193,7 +1194,9 @@ CPlayerPed::ProcessAnimGroups(void)
else
groupToSet = ASSOCGRP_PLAYERBACK;
}
- } else {
+ } else
+#endif
+ {
if (GetWeapon()->m_eWeaponType == WEAPONTYPE_ROCKETLAUNCHER) {
groupToSet = ASSOCGRP_PLAYERROCKET;
} else {