summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorwithmorten <morten.with@gmail.com>2021-01-18 17:25:31 +0100
committerwithmorten <morten.with@gmail.com>2021-01-18 17:25:31 +0100
commitdf4e22e3d010b3dd70e0f6add5764b7265370a12 (patch)
tree8a8eefa46a2ff948c6e0a522ac2fc2a90c7111b4 /src
parentsync milessdk with re3mss (diff)
downloadre3-df4e22e3d010b3dd70e0f6add5764b7265370a12.tar
re3-df4e22e3d010b3dd70e0f6add5764b7265370a12.tar.gz
re3-df4e22e3d010b3dd70e0f6add5764b7265370a12.tar.bz2
re3-df4e22e3d010b3dd70e0f6add5764b7265370a12.tar.lz
re3-df4e22e3d010b3dd70e0f6add5764b7265370a12.tar.xz
re3-df4e22e3d010b3dd70e0f6add5764b7265370a12.tar.zst
re3-df4e22e3d010b3dd70e0f6add5764b7265370a12.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/Cam.cpp7
-rw-r--r--src/vehicles/Automobile.cpp7
-rw-r--r--src/vehicles/Bike.cpp7
-rw-r--r--src/vehicles/Boat.cpp9
-rw-r--r--src/vehicles/Vehicle.cpp9
5 files changed, 36 insertions, 3 deletions
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index d8c66279..ed82b68e 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -5062,6 +5062,13 @@ CCam::Process_FollowCar_SA(const CVector& CameraTarget, float TargetOrientation,
float stickX = -(pad->GetCarGunLeftRight());
float stickY = pad->GetCarGunUpDown();
+ // In SA this checks for m_bUseMouse3rdPerson so num2 / num8 do not move camera
+ // when Keyboard & Mouse controls are used. To make it work better with III/VC, check for actual pad state instead
+ if (!CPad::IsAffectedByController && !isCar)
+ stickY = 0.0f;
+ else if (CPad::bInvertLook4Pad)
+ stickY = -stickY;
+
if (CCamera::m_bUseMouse3rdPerson)
stickY = 0.0f;
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index cafd4a36..89ba43d9 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -1424,7 +1424,12 @@ CAutomobile::ProcessControl(void)
if (GetModelIndex() == MI_RCRAIDER || GetModelIndex() == MI_RCGOBLIN)
FlyingControl(FLIGHT_MODEL_RCHELI);
else if (m_nWheelsOnGround < 4 && !(GetModelIndex() == MI_SEASPAR && bTouchingWater) ||
- CPad::GetPad(0)->GetAccelerate() != 0 || CPad::GetPad(0)->GetCarGunUpDown() > 1.0f ||
+ CPad::GetPad(0)->GetAccelerate() != 0 ||
+#ifndef FREE_CAM
+ CPad::GetPad(0)->GetCarGunUpDown() > 1.0f ||
+#else
+ ((!CCamera::bFreeCam || (CCamera::bFreeCam && !CPad::IsAffectedByController)) && CPad::GetPad(0)->GetCarGunUpDown() > 1.0f) ||
+#endif
Abs(m_vecMoveSpeed.x) > 0.02f ||
Abs(m_vecMoveSpeed.y) > 0.02f ||
Abs(m_vecMoveSpeed.z) > 0.02f)
diff --git a/src/vehicles/Bike.cpp b/src/vehicles/Bike.cpp
index 17d8592e..d588e777 100644
--- a/src/vehicles/Bike.cpp
+++ b/src/vehicles/Bike.cpp
@@ -1844,7 +1844,12 @@ CBike::ProcessControlInputs(uint8 pad)
m_fSteerInput = clamp(m_fSteerInput, -1.0f, 1.0f);
// Lean forward/backward
- float updown = -CPad::GetPad(pad)->GetSteeringUpDown()/128.0f + CPad::GetPad(pad)->GetCarGunUpDown()/128.0f;
+ float updown;
+#ifdef FREE_CAM
+ if (CCamera::bFreeCam) updown = CPad::IsAffectedByController ? -CPad::GetPad(pad)->GetSteeringUpDown()/128.0f : CPad::GetPad(pad)->GetCarGunUpDown()/128.0f;
+ else
+#endif
+ updown = -CPad::GetPad(pad)->GetSteeringUpDown()/128.0f + CPad::GetPad(pad)->GetCarGunUpDown()/128.0f;
m_fLeanInput += (updown - m_fLeanInput)*0.2f*CTimer::GetTimeStep();
m_fLeanInput = clamp(m_fLeanInput, -1.0f, 1.0f);
diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp
index 8dec0f89..0e978570 100644
--- a/src/vehicles/Boat.cpp
+++ b/src/vehicles/Boat.cpp
@@ -964,7 +964,14 @@ CBoat::PreRender(void)
// FIX: Planes can also be controlled with GetCarGunUpDown
#ifdef FIX_BUGS
static float steeringUpDown = 0.0f;
- steeringUpDown += ((Abs(CPad::GetPad(0)->GetCarGunUpDown()) > 1.0f ? (-CPad::GetPad(0)->GetCarGunUpDown() / 128.0f) : (-CPad::GetPad(0)->GetSteeringUpDown() / 128.0f)) - steeringUpDown) * Min(1.f, CTimer::GetTimeStep() / 5.f);
+#ifdef FREE_CAM
+ if(!CCamera::bFreeCam || (CCamera::bFreeCam && !CPad::IsAffectedByController))
+#endif
+ steeringUpDown += ((Abs(CPad::GetPad(0)->GetCarGunUpDown()) > 1.0f ? (-CPad::GetPad(0)->GetCarGunUpDown()/128.0f) : (-CPad::GetPad(0)->GetSteeringUpDown()/128.0f)) - steeringUpDown) * Min(1.f, CTimer::GetTimeStep()/5.f);
+#ifdef FREE_CAM
+ else
+ steeringUpDown = -CPad::GetPad(0)->GetSteeringUpDown()/128.0f;
+#endif
#else
float steeringUpDown = -CPad::GetPad(0)->GetSteeringUpDown()/128.0f;
#endif
diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp
index 5fb5a5d4..a464c128 100644
--- a/src/vehicles/Vehicle.cpp
+++ b/src/vehicles/Vehicle.cpp
@@ -334,6 +334,9 @@ CVehicle::FlyingControl(eFlightModel flightModel)
float fSteerLR = CPad::GetPad(0)->GetSteeringLeftRight() / 128.0f;
float fSteerUD = -CPad::GetPad(0)->GetSteeringUpDown() / 128.0f;
float fGunUD = Abs(CPad::GetPad(0)->GetCarGunUpDown());
+#ifdef FREE_CAM
+ if(!CCamera::bFreeCam || (CCamera::bFreeCam && !CPad::IsAffectedByController))
+#endif
if(fGunUD > 1.0f)
fSteerUD = -CPad::GetPad(0)->GetCarGunUpDown() / 128.0f;
@@ -507,9 +510,15 @@ CVehicle::FlyingControl(eFlightModel flightModel)
fYaw = CPad::GetPad(0)->GetLookRight();
if (CPad::GetPad(0)->GetLookLeft())
fYaw = -1.0f;
+#ifdef FREE_CAM
+ if (!CCamera::bFreeCam || (CCamera::bFreeCam && !CPad::IsAffectedByController))
+#endif
if(Abs(CPad::GetPad(0)->GetCarGunLeftRight()) > 1.0f)
fYaw = CPad::GetPad(0)->GetCarGunLeftRight() / 128.0f;
}
+#ifdef FREE_CAM
+ if(!CCamera::bFreeCam || (CCamera::bFreeCam && !CPad::IsAffectedByController))
+#endif
if(Abs(CPad::GetPad(0)->GetCarGunUpDown()) > 1.0f)
fPitch = -CPad::GetPad(0)->GetCarGunUpDown() / 128.0f;
if (CPad::GetPad(0)->GetHorn()) {