summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-05-10 20:51:29 +0200
committeraap <aap@papnet.eu>2020-05-10 20:51:29 +0200
commit9e842f1628c273d20fb8221e8b42198880b127fe (patch)
treea9e71674dcd33c80f54bb22b1abf482a550cb4a2 /src
parentforce load weapons as long as we dont stream em yet (diff)
downloadre3-9e842f1628c273d20fb8221e8b42198880b127fe.tar
re3-9e842f1628c273d20fb8221e8b42198880b127fe.tar.gz
re3-9e842f1628c273d20fb8221e8b42198880b127fe.tar.bz2
re3-9e842f1628c273d20fb8221e8b42198880b127fe.tar.lz
re3-9e842f1628c273d20fb8221e8b42198880b127fe.tar.xz
re3-9e842f1628c273d20fb8221e8b42198880b127fe.tar.zst
re3-9e842f1628c273d20fb8221e8b42198880b127fe.zip
Diffstat (limited to '')
-rw-r--r--src/core/Cam.cpp6
-rw-r--r--src/core/re3.cpp2
-rw-r--r--src/modelinfo/VehicleModelInfo.cpp37
-rw-r--r--src/vehicles/Automobile.cpp18
-rw-r--r--src/vehicles/Automobile.h2
-rw-r--r--src/vehicles/Bike.h13
-rw-r--r--src/vehicles/Boat.h6
-rw-r--r--src/vehicles/Plane.h7
-rw-r--r--src/vehicles/Vehicle.cpp9
-rw-r--r--src/vehicles/Vehicle.h2
10 files changed, 63 insertions, 39 deletions
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index ae7df51f..62d940ad 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -29,7 +29,7 @@ bool PrintDebugCode = false;
int16 DebugCamMode;
#ifdef FREE_CAM
-bool CCamera::bFreeCam = true;
+bool CCamera::bFreeCam = false;
int nPreviousMode = -1;
#endif
@@ -280,12 +280,12 @@ CCam::Process(void)
if(DirectionWasLooking != LOOKING_BEHIND)
TheCamera.m_bJust_Switched = true;
DirectionWasLooking = LOOKING_BEHIND;
- }else if(CPad::GetPad(0)->GetLookLeft()){
+ }else if(!((CVehicle*)CamTargetEntity)->IsRealHeli() && CPad::GetPad(0)->GetLookLeft()){
LookLeft();
if(DirectionWasLooking != LOOKING_LEFT)
TheCamera.m_bJust_Switched = true;
DirectionWasLooking = LOOKING_LEFT;
- }else if(CPad::GetPad(0)->GetLookRight()){
+ }else if(!((CVehicle*)CamTargetEntity)->IsRealHeli() && CPad::GetPad(0)->GetLookRight()){
LookRight();
if(DirectionWasLooking != LOOKING_RIGHT)
TheCamera.m_bJust_Switched = true;
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index a2c0a9a3..8ed27eef 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -323,7 +323,7 @@ DebugMenuPopulate(void)
DebugMenuAddCmd("Spawn", "Spawn Banshee", [](){ SpawnCar(MI_BANSHEE); });
DebugMenuAddCmd("Spawn", "Spawn Cuban", [](){ SpawnCar(MI_CUBAN); });
DebugMenuAddCmd("Spawn", "Spawn Voodoo", [](){ SpawnCar(MI_VOODOO); });
- DebugMenuAddCmd("Spawn", "Spawn Dodo", [](){ SpawnCar(MI_DODO); });
+ DebugMenuAddCmd("Spawn", "Spawn Sparrow", [](){ SpawnCar(MI_SPARROW); });
DebugMenuAddCmd("Spawn", "Spawn Rhino", [](){ SpawnCar(MI_RHINO); });
DebugMenuAddCmd("Spawn", "Spawn Firetruck", [](){ SpawnCar(MI_FIRETRUCK); });
DebugMenuAddCmd("Spawn", "Spawn Predator", [](){ SpawnCar(MI_PREDATOR); });
diff --git a/src/modelinfo/VehicleModelInfo.cpp b/src/modelinfo/VehicleModelInfo.cpp
index 121e7baf..a10073e4 100644
--- a/src/modelinfo/VehicleModelInfo.cpp
+++ b/src/modelinfo/VehicleModelInfo.cpp
@@ -16,6 +16,7 @@
#include "Train.h"
#include "Plane.h"
#include "Heli.h"
+#include "Bike.h"
#include "ModelIndices.h"
#include "ModelInfo.h"
@@ -82,9 +83,13 @@ RwObjectNameIdAssocation carIds[] = {
};
RwObjectNameIdAssocation boatIds[] = {
- { "boat_moving_hi", BOAT_MOVING, VEHICLE_FLAG_COLLAPSE },
- { "boat_rudder_hi", BOAT_RUDDER, VEHICLE_FLAG_COLLAPSE },
- { "windscreen", BOAT_WINDSCREEN, VEHICLE_FLAG_WINDSCREEN | VEHICLE_FLAG_COLLAPSE },
+ { "boat_moving_hi", BOAT_MOVING, 0 },
+ { "boat_rudder_hi", BOAT_RUDDER, 0 },
+ { "boat_flap_left", BOAT_FLAP_LEFT, 0 },
+ { "boat_flap_right", BOAT_FLAP_RIGHT, 0 },
+ { "boat_rearflap_left", BOAT_REARFLAP_LEFT, 0 },
+ { "boat_rearflap_right", BOAT_REARFLAP_RIGHT, 0 },
+ { "windscreen_hi_ok", BOAT_WINDSCREEN, VEHICLE_FLAG_WINDSCREEN | VEHICLE_FLAG_DRAWLAST },
{ "ped_frontseat", BOAT_POS_FRONTSEAT, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
{ nil, 0, 0 }
};
@@ -112,8 +117,8 @@ RwObjectNameIdAssocation heliIds[] = {
};
RwObjectNameIdAssocation planeIds[] = {
- { "wheel_front_dummy", 2, 0 },
- { "wheel_rear_dummy", 3, 0 },
+ { "wheel_front_dummy", PLANE_WHEEL_FRONT, 0 },
+ { "wheel_rear_dummy", PLANE_WHEEL_READ, 0 },
{ "light_tailplane", PLANE_POS_LIGHT_TAIL, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
{ "light_left", PLANE_POS_LIGHT_LEFT, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
{ "light_right", PLANE_POS_LIGHT_RIGHT, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
@@ -121,16 +126,18 @@ RwObjectNameIdAssocation planeIds[] = {
};
RwObjectNameIdAssocation bikeIds[] = {
- { "chassis_dummy", 1, 0 },
- { "forks_front", 2, 0 },
- { "forks_rear", 3, 0 },
- { "wheel_front", 4, 0 },
- { "wheel_rear", 5, 0 },
- { "mudguard", 6, 0 },
- { "ped_frontseat", 2, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
- { "headlights", 0, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
- { "taillights", 1, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
- { "exhaust", 9, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
+ { "chassis_dummy", BIKE_CHASSIS, 0 },
+ { "forks_front", BIKE_FORKS_FRONT, 0 },
+ { "forks_rear", BIKE_FORKS_REAR, 0 },
+ { "wheel_front", BIKE_WHEEL_FRONT, 0 },
+ { "wheel_rear", BIKE_WHEEL_REAR, 0 },
+ { "mudguard", BIKE_MUDGUARD, 0 },
+ { "handlebars", BIKE_HANDLEBARS, 0 },
+ { "ped_frontseat", BIKE_POS_FRONTSEAT, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
+ { "ped_backseat", BIKE_POS_BACKSEAT, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
+ { "headlights", BIKE_POS_HEADLIGHTS, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
+ { "taillights", BIKE_POS_TAILLIGHTS, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
+ { "exhaust", BIKE_POS_EXHAUST, VEHICLE_FLAG_POS | CLUMP_FLAG_NO_HIERID },
{ "extra1", 0, VEHICLE_FLAG_DRAWLAST | VEHICLE_FLAG_COMP | CLUMP_FLAG_NO_HIERID },
{ "extra2", 0, VEHICLE_FLAG_DRAWLAST | VEHICLE_FLAG_COMP | CLUMP_FLAG_NO_HIERID },
{ "extra3", 0, VEHICLE_FLAG_DRAWLAST | VEHICLE_FLAG_COMP | CLUMP_FLAG_NO_HIERID },
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 8ecea0ff..50eec49f 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -195,7 +195,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
CMatrix mat2(RwFrameGetMatrix(m_aCarNodes[CAR_WHEEL_LF]));
mat1.GetPosition() += CVector(mat2.GetPosition().x + 0.1f, 0.0f, mat2.GetPosition().z);
mat1.UpdateRW();
- }else if(GetModelIndex() == MI_SPARROW || GetModelIndex() == MI_RCRAIDER){
+ }else if(IsRealHeli()){
RpAtomicSetFlags((RpAtomic*)GetFirstObject(m_aCarNodes[CAR_WHEEL_LF]), 0);
RpAtomicSetFlags((RpAtomic*)GetFirstObject(m_aCarNodes[CAR_WHEEL_RF]), 0);
RpAtomicSetFlags((RpAtomic*)GetFirstObject(m_aCarNodes[CAR_WHEEL_LB]), 0);
@@ -672,9 +672,7 @@ CAutomobile::ProcessControl(void)
acceleration /= m_fForceMultiplier;
// unused
- if(GetModelIndex() == MI_RCBARON ||
- GetModelIndex() == MI_RCRAIDER ||
- GetModelIndex() == MI_SPARROW)
+ if(GetModelIndex() == MI_RCBARON || IsRealHeli())
acceleration = 0.0f;
brake = m_fBrakePedal * pHandling->fBrakeDeceleration * CTimer::GetTimeStep();
@@ -1023,18 +1021,18 @@ CAutomobile::ProcessControl(void)
FlyingControl(FLIGHT_MODEL_DODO);
}else if(GetModelIndex() == MI_RCBARON){
FlyingControl(FLIGHT_MODEL_RCPLANE);
- }else if(GetModelIndex() == MI_RCRAIDER || GetModelIndex() == MI_SPARROW || bAllCarCheat){
+ }else if(IsRealHeli() || bAllCarCheat){
#ifdef ALLCARSHELI_CHEAT
if (bAllCarCheat)
FlyingControl(FLIGHT_MODEL_HELI);
else
#endif
{
- if (CPad::GetPad(0)->GetCircleJustDown())
- m_aWheelSpeed[0] = Max(m_aWheelSpeed[0] - 0.03f, 0.0f);
- if (m_aWheelSpeed[0] < 0.22f)
- m_aWheelSpeed[0] += 0.0001f;
- if (m_aWheelSpeed[0] > 0.15f)
+ // if (CPad::GetPad(0)->GetCircleJustDown())
+ // m_aWheelSpeed[0] = Max(m_aWheelSpeed[0] - 0.03f, 0.0f);
+ // if (m_aWheelSpeed[0] < 0.22f)
+ // m_aWheelSpeed[0] += 0.0001f;
+ // if (m_aWheelSpeed[0] > 0.15f)
FlyingControl(FLIGHT_MODEL_HELI);
}
}
diff --git a/src/vehicles/Automobile.h b/src/vehicles/Automobile.h
index 0356a9f2..b9f130f8 100644
--- a/src/vehicles/Automobile.h
+++ b/src/vehicles/Automobile.h
@@ -36,7 +36,7 @@ enum eCarPositions
CAR_POS_TAILLIGHTS,
CAR_POS_FRONTSEAT,
CAR_POS_BACKSEAT,
- CAR_POS_EXHAUST = 9,
+ CAR_POS_EXHAUST
};
// These are used for all the wheel arrays
diff --git a/src/vehicles/Bike.h b/src/vehicles/Bike.h
index 4e7e5a0e..85cd3213 100644
--- a/src/vehicles/Bike.h
+++ b/src/vehicles/Bike.h
@@ -1,7 +1,5 @@
#pragma once
-// some miami bike leftovers
-
enum eBikeNodes {
BIKE_NODE_NONE,
BIKE_CHASSIS,
@@ -12,4 +10,13 @@ enum eBikeNodes {
BIKE_MUDGUARD,
BIKE_HANDLEBARS,
BIKE_NUM_NODES
-}; \ No newline at end of file
+};
+
+enum eBikePositions
+{
+ BIKE_POS_HEADLIGHTS,
+ BIKE_POS_TAILLIGHTS,
+ BIKE_POS_FRONTSEAT,
+ BIKE_POS_BACKSEAT,
+ BIKE_POS_EXHAUST
+};
diff --git a/src/vehicles/Boat.h b/src/vehicles/Boat.h
index cde5de84..7a0a9be4 100644
--- a/src/vehicles/Boat.h
+++ b/src/vehicles/Boat.h
@@ -5,8 +5,12 @@
enum eBoatNodes
{
BOAT_MOVING = 1,
+ BOAT_WINDSCREEN,
BOAT_RUDDER,
- BOAT_WINDSCREEN
+ BOAT_FLAP_LEFT,
+ BOAT_FLAP_RIGHT,
+ BOAT_REARFLAP_LEFT,
+ BOAT_REARFLAP_RIGHT
};
class CBoat : public CVehicle
diff --git a/src/vehicles/Plane.h b/src/vehicles/Plane.h
index 6fa6776b..a9afa4bc 100644
--- a/src/vehicles/Plane.h
+++ b/src/vehicles/Plane.h
@@ -2,6 +2,13 @@
#include "Vehicle.h"
+enum ePlaneNodes
+{
+ PLANE_WHEEL_FRONT = 2,
+ PLANE_WHEEL_READ,
+ NUM_PLANE_NODES
+};
+
enum ePlanePositions
{
PLANE_POS_LIGHT_LEFT,
diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp
index d0341058..b6045062 100644
--- a/src/vehicles/Vehicle.cpp
+++ b/src/vehicles/Vehicle.cpp
@@ -423,17 +423,16 @@ CVehicle::FlyingControl(eFlightModel flightModel)
}
else {
fPitch = CPad::GetPad(0)->GetSteeringUpDown() / 128.0f;
- fRoll = CPad::GetPad(0)->GetLookLeft();
- if (CPad::GetPad(0)->GetLookRight())
- fRoll = -1.0f;
- fYaw = CPad::GetPad(0)->GetSteeringLeftRight() / 128.0f;
+ fYaw = CPad::GetPad(0)->GetLookRight();
+ if (CPad::GetPad(0)->GetLookLeft())
+ fYaw = -1.0f;
+ fRoll = -CPad::GetPad(0)->GetSteeringLeftRight() / 128.0f;
}
if (CPad::GetPad(0)->GetHorn()) {
fYaw = 0.0f;
fPitch = clamp(10.0f * DotProduct(m_vecMoveSpeed, GetUp()), -200.0f, 1.3f);
fRoll = clamp(10.0f * DotProduct(m_vecMoveSpeed, GetRight()), -200.0f, 1.3f);
}
- debug("fPitch: %f\n", fPitch);
ApplyTurnForce(fPitch * GetUp() * fPitchVar * m_fTurnMass * CTimer::GetTimeStep(), GetForward());
ApplyTurnForce(fRoll * GetUp() * fRollVar * m_fTurnMass * CTimer::GetTimeStep(), GetRight());
ApplyTurnForce(fYaw * GetForward() * fYawVar * m_fTurnMass * CTimer::GetTimeStep(), GetRight());
diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h
index 3b6d778e..0ef454fd 100644
--- a/src/vehicles/Vehicle.h
+++ b/src/vehicles/Vehicle.h
@@ -5,6 +5,7 @@
#include "ModelIndices.h"
#include "AnimManager.h"
#include "Weapon.h"
+#include "HandlingMgr.h"
class CPed;
class CFire;
@@ -294,6 +295,7 @@ public:
bool IsAlarmOn(void) { return m_nAlarmState != 0 && m_nAlarmState != -1; }
CVehicleModelInfo* GetModelInfo() { return (CVehicleModelInfo*)CModelInfo::GetModelInfo(GetModelIndex()); }
bool IsTaxi(void) { return GetModelIndex() == MI_TAXI || GetModelIndex() == MI_CABBIE || GetModelIndex() == MI_ZEBRA || GetModelIndex() == MI_KAUFMAN; }
+ bool IsRealHeli(void) { return !!(pHandling->Flags & HANDLING_IS_HELI); }
AnimationId GetDriverAnim(void) { return IsCar() && bLowVehicle ? ANIM_CAR_LSIT : (IsBoat() && GetModelIndex() != MI_SPEEDER ? ANIM_DRIVE_BOAT : ANIM_CAR_SIT); }
static bool bWheelsOnlyCheat;