diff options
Diffstat (limited to '')
-rw-r--r-- | src/DamageManager.h | 9 | ||||
-rw-r--r-- | src/Door.h | 17 | ||||
-rw-r--r-- | src/audio/AudioManager.cpp | 87 | ||||
-rw-r--r-- | src/control/AutoPilot.h | 5 | ||||
-rw-r--r-- | src/control/Replay.cpp | 126 | ||||
-rw-r--r-- | src/entities/Automobile.h | 63 | ||||
-rw-r--r-- | src/entities/Physical.cpp | 8 | ||||
-rw-r--r-- | src/entities/Vehicle.h | 127 | ||||
-rw-r--r-- | src/modelinfo/VehicleModelInfo.cpp | 28 |
9 files changed, 243 insertions, 227 deletions
diff --git a/src/DamageManager.h b/src/DamageManager.h index 974c54ee..1fdbc6b1 100644 --- a/src/DamageManager.h +++ b/src/DamageManager.h @@ -46,15 +46,6 @@ enum eLights }; enum { - VEHDOOR_BONNET = 0, - VEHDOOR_BOOT, - VEHDOOR_FRONT_LEFT, - VEHDOOR_FRONT_RIGHT, - VEHDOOR_REAR_LEFT, - VEHDOOR_REAR_RIGHT -}; - -enum { VEHPANEL_FRONT_LEFT, VEHPANEL_FRONT_RIGHT, VEHPANEL_REAR_LEFT, diff --git a/src/Door.h b/src/Door.h deleted file mode 100644 index 99fae5f1..00000000 --- a/src/Door.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "common.h" - -struct CDoor -{ - float m_fAngleWhenOpened; - float m_fAngleWhenClosed; - char field_8; - char field_9; - char field_10; - char field_11; - float m_fAngle; - float m_fPreviousAngle; - float m_fAngularVelocity; - CVector m_vecVelocity; -};
\ No newline at end of file diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index 812c9d62..76ef8244 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -1,3 +1,6 @@ +#include "common.h" +#include "patcher.h" + #include "AudioManager.h" #include "DMAudio.h" @@ -10,10 +13,80 @@ #include "Vehicle.h" #include "World.h" -#include "common.h" -#include "patcher.h" - -#include <cmath> +// TODO: where is this used? Is this the right file? +enum eVehicleModel +{ + LANDSTAL, + IDAHO, + STINGER, + LINERUN, + PEREN, + SENTINEL, + PATRIOT, + FIRETRUK, + TRASH, + STRETCH, + MANANA, + INFERNUS, + BLISTA, + PONY, + MULE, + CHEETAH, + AMBULAN, + FBICAR, + MOONBEAM, + ESPERANT, + TAXI, + KURUMA, + BOBCAT, + MRWHOOP, + BFINJECT, + CORPSE, + POLICE, + ENFORCER, + SECURICA, + BANSHEE, + PREDATOR, + BUS, + RHINO, + BARRACKS, + TRAIN, + CHOPPER, + DODO, + COACH, + CABBIE, + STALLION, + RUMPO, + RCBANDIT, + BELLYUP, + MRWONGS, + MAFIA, + YARDIE, + YAKUZA, + DIABLOS, + COLUMB, + HOODS, + AIRTRAIN, + DEADDODO, + SPEEDER, + REEFER, + PANLANT, + FLATBED, + YANKEE, + ESCAPE, + BORGNINE, + TOYZ, + GHOST, + CAR151, + CAR152, + CAR153, + CAR154, + CAR155, + CAR156, + CAR157, + CAR158, + CAR159, +}; cAudioManager &AudioManager = *(cAudioManager *)0x880FC0; @@ -132,7 +205,7 @@ void cAudioManager::CalculateDistance(bool *ptr, float dist) { if(*ptr == false) { - m_sQueueSample.m_fDistance = std::sqrt(dist); + m_sQueueSample.m_fDistance = sqrt(dist); *ptr = true; } } @@ -267,14 +340,14 @@ cAudioManager::ClearRequestedQueue() bool cAudioManager::UsesReverseWarning(int32 model) { - return model == LINERUN || std::abs(model - FIRETRUK) <= 1 || model == BUS || + return model == LINERUN || fabs(model - FIRETRUK) <= 1 || model == BUS || model == COACH; // fix } bool cAudioManager::HasAirBrakes(int32 model) { - return model == LINERUN || std::abs(model - FIRETRUK) <= 1 || model == BUS || + return model == LINERUN || fabs(model - FIRETRUK) <= 1 || model == BUS || model == COACH; // fix } diff --git a/src/control/AutoPilot.h b/src/control/AutoPilot.h index a2458327..97b02f5c 100644 --- a/src/control/AutoPilot.h +++ b/src/control/AutoPilot.h @@ -81,12 +81,9 @@ public: float m_fMaxTrafficSpeed; uint8 m_nCruiseSpeed; uint8 m_nCarCtrlFlags; - int8 pad1[2]; CVector m_vecDestinationCoors; void *m_aPathFindNodesInfo[8]; uint16 m_nPathFindNodesCount; - int8 pad2[2]; CVehicle *m_pTargetCar; }; - -static_assert(sizeof(CAutoPilot) == 0x70, "CAutoPilot: error");
\ No newline at end of file +static_assert(sizeof(CAutoPilot) == 0x70, "CAutoPilot: error"); diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp index cb3b27d0..e166e6b5 100644 --- a/src/control/Replay.cpp +++ b/src/control/Replay.cpp @@ -135,33 +135,33 @@ WRAPPER static void ApplyPanelDamageToCar(uint32, CAutomobile*, bool) { EAXJMP(0 #else static void ApplyPanelDamageToCar(uint32 panels, CAutomobile* vehicle, bool flying) { - if(vehicle->m_DamageManager.GetPanelStatus(VEHPANEL_FRONT_LEFT) != CDamageManager::GetPanelStatus(panels, VEHPANEL_FRONT_LEFT)){ - vehicle->m_DamageManager.SetPanelStatus(VEHPANEL_FRONT_LEFT, CDamageManager::GetPanelStatus(panels, VEHPANEL_FRONT_LEFT)); - vehicle->SetPanelDamage(13, VEHPANEL_FRONT_LEFT, flying); + if(vehicle->Damage.GetPanelStatus(VEHPANEL_FRONT_LEFT) != CDamageManager::GetPanelStatus(panels, VEHPANEL_FRONT_LEFT)){ + vehicle->Damage.SetPanelStatus(VEHPANEL_FRONT_LEFT, CDamageManager::GetPanelStatus(panels, VEHPANEL_FRONT_LEFT)); + vehicle->SetPanelDamage(CAR_WING_LF, VEHPANEL_FRONT_LEFT, flying); } - if(vehicle->m_DamageManager.GetPanelStatus(VEHPANEL_FRONT_RIGHT) != CDamageManager::GetPanelStatus(panels, VEHPANEL_FRONT_RIGHT)){ - vehicle->m_DamageManager.SetPanelStatus(VEHPANEL_FRONT_RIGHT, CDamageManager::GetPanelStatus(panels, VEHPANEL_FRONT_RIGHT)); - vehicle->SetPanelDamage(9, VEHPANEL_FRONT_RIGHT, flying); + if(vehicle->Damage.GetPanelStatus(VEHPANEL_FRONT_RIGHT) != CDamageManager::GetPanelStatus(panels, VEHPANEL_FRONT_RIGHT)){ + vehicle->Damage.SetPanelStatus(VEHPANEL_FRONT_RIGHT, CDamageManager::GetPanelStatus(panels, VEHPANEL_FRONT_RIGHT)); + vehicle->SetPanelDamage(CAR_WING_RF, VEHPANEL_FRONT_RIGHT, flying); } - if(vehicle->m_DamageManager.GetPanelStatus(VEHPANEL_REAR_LEFT) != CDamageManager::GetPanelStatus(panels, VEHPANEL_REAR_LEFT)){ - vehicle->m_DamageManager.SetPanelStatus(VEHPANEL_REAR_LEFT, CDamageManager::GetPanelStatus(panels, VEHPANEL_REAR_LEFT)); - vehicle->SetPanelDamage(14, VEHPANEL_REAR_LEFT, flying); + if(vehicle->Damage.GetPanelStatus(VEHPANEL_REAR_LEFT) != CDamageManager::GetPanelStatus(panels, VEHPANEL_REAR_LEFT)){ + vehicle->Damage.SetPanelStatus(VEHPANEL_REAR_LEFT, CDamageManager::GetPanelStatus(panels, VEHPANEL_REAR_LEFT)); + vehicle->SetPanelDamage(CAR_WING_LR, VEHPANEL_REAR_LEFT, flying); } - if(vehicle->m_DamageManager.GetPanelStatus(VEHPANEL_REAR_RIGHT) != CDamageManager::GetPanelStatus(panels, VEHPANEL_REAR_RIGHT)){ - vehicle->m_DamageManager.SetPanelStatus(VEHPANEL_REAR_RIGHT, CDamageManager::GetPanelStatus(panels, VEHPANEL_REAR_RIGHT)); - vehicle->SetPanelDamage(10, VEHPANEL_REAR_RIGHT, flying); + if(vehicle->Damage.GetPanelStatus(VEHPANEL_REAR_RIGHT) != CDamageManager::GetPanelStatus(panels, VEHPANEL_REAR_RIGHT)){ + vehicle->Damage.SetPanelStatus(VEHPANEL_REAR_RIGHT, CDamageManager::GetPanelStatus(panels, VEHPANEL_REAR_RIGHT)); + vehicle->SetPanelDamage(CAR_WING_RR, VEHPANEL_REAR_RIGHT, flying); } - if(vehicle->m_DamageManager.GetPanelStatus(VEHPANEL_WINDSCREEN) != CDamageManager::GetPanelStatus(panels, VEHPANEL_WINDSCREEN)){ - vehicle->m_DamageManager.SetPanelStatus(VEHPANEL_WINDSCREEN, CDamageManager::GetPanelStatus(panels, VEHPANEL_WINDSCREEN)); - vehicle->SetPanelDamage(19, VEHPANEL_WINDSCREEN, flying); + if(vehicle->Damage.GetPanelStatus(VEHPANEL_WINDSCREEN) != CDamageManager::GetPanelStatus(panels, VEHPANEL_WINDSCREEN)){ + vehicle->Damage.SetPanelStatus(VEHPANEL_WINDSCREEN, CDamageManager::GetPanelStatus(panels, VEHPANEL_WINDSCREEN)); + vehicle->SetPanelDamage(CAR_WINDSCREEN, VEHPANEL_WINDSCREEN, flying); } - if(vehicle->m_DamageManager.GetPanelStatus(VEHBUMPER_FRONT) != CDamageManager::GetPanelStatus(panels, VEHBUMPER_FRONT)){ - vehicle->m_DamageManager.SetPanelStatus(VEHBUMPER_FRONT, CDamageManager::GetPanelStatus(panels, VEHBUMPER_FRONT)); - vehicle->SetPanelDamage(7, VEHBUMPER_FRONT, flying); + if(vehicle->Damage.GetPanelStatus(VEHBUMPER_FRONT) != CDamageManager::GetPanelStatus(panels, VEHBUMPER_FRONT)){ + vehicle->Damage.SetPanelStatus(VEHBUMPER_FRONT, CDamageManager::GetPanelStatus(panels, VEHBUMPER_FRONT)); + vehicle->SetPanelDamage(CAR_BUMP_FRONT, VEHBUMPER_FRONT, flying); } - if(vehicle->m_DamageManager.GetPanelStatus(VEHBUMPER_REAR) != CDamageManager::GetPanelStatus(panels, VEHBUMPER_REAR)){ - vehicle->m_DamageManager.SetPanelStatus(VEHBUMPER_REAR, CDamageManager::GetPanelStatus(panels, VEHBUMPER_REAR)); - vehicle->SetPanelDamage(8, VEHBUMPER_REAR, flying); + if(vehicle->Damage.GetPanelStatus(VEHBUMPER_REAR) != CDamageManager::GetPanelStatus(panels, VEHBUMPER_REAR)){ + vehicle->Damage.SetPanelStatus(VEHBUMPER_REAR, CDamageManager::GetPanelStatus(panels, VEHBUMPER_REAR)); + vehicle->SetPanelDamage(CAR_BUMP_REAR, VEHBUMPER_REAR, flying); } } #endif @@ -624,7 +624,7 @@ void CReplay::StoreCarUpdate(CVehicle *vehicle, int id) vp->matrix.CompressFromFullMatrix(vehicle->GetMatrix()); vp->health = vehicle->m_fHealth / 4.0f; /* Not anticipated that health can be > 1000. */ vp->acceleration = vehicle->m_fGasPedal * 100.0f; - vp->panels = vehicle->IsCar() ? ((CAutomobile*)vehicle)->m_DamageManager.m_panelStatus : 0; + vp->panels = vehicle->IsCar() ? ((CAutomobile*)vehicle)->Damage.m_panelStatus : 0; vp->velocityX = 8000.0f * max(-4.0f, min(4.0f, vehicle->GetSpeed().x)); /* 8000!? */ vp->velocityY = 8000.0f * max(-4.0f, min(4.0f, vehicle->GetSpeed().y)); vp->velocityZ = 8000.0f * max(-4.0f, min(4.0f, vehicle->GetSpeed().z)); @@ -638,14 +638,14 @@ void CReplay::StoreCarUpdate(CVehicle *vehicle, int id) if (vehicle->IsCar()){ CAutomobile* car = (CAutomobile*)vehicle; for (int i = 0; i < 4; i++){ - vp->wheel_susp_dist[i] = 50.0f * car->m_afWheelSuspDist[i]; - vp->wheel_rotation[i] = 128.0f / M_PI * car->m_afWheelRotation[i]; + vp->wheel_susp_dist[i] = 50.0f * car->m_aWheelDist[i]; + vp->wheel_rotation[i] = 128.0f / M_PI * car->m_aWheelRotation[i]; } - vp->door_angles[0] = 127.0f / M_PI * car->m_aDoors[2].m_fAngle; - vp->door_angles[1] = 127.0f / M_PI * car->m_aDoors[3].m_fAngle; + vp->door_angles[0] = 127.0f / M_PI * car->Doors[2].m_fAngle; + vp->door_angles[1] = 127.0f / M_PI * car->Doors[3].m_fAngle; vp->door_status = 0; for (int i = 0; i < 6; i++){ - if (car->m_DamageManager.GetDoorStatus(i) == 3) + if (car->Damage.GetDoorStatus(i) == 3) vp->door_status |= BIT(i); } } @@ -683,42 +683,42 @@ void CReplay::ProcessCarUpdate(CVehicle *vehicle, float interpolation, CAddressI if (vehicle->IsCar()) { CAutomobile* car = (CAutomobile*)vehicle; for (int i = 0; i < 4; i++) { - car->m_afWheelSuspDist[i] = vp->wheel_susp_dist[i] / 50.0f; - car->m_afWheelRotation[i] = vp->wheel_rotation[i] * M_PI / 128.0f; + car->m_aWheelDist[i] = vp->wheel_susp_dist[i] / 50.0f; + car->m_aWheelRotation[i] = vp->wheel_rotation[i] * M_PI / 128.0f; } - car->m_aDoors[2].m_fAngle = car->m_aDoors[2].m_fPreviousAngle = vp->door_angles[0] * M_PI / 127.0f; - car->m_aDoors[3].m_fAngle = car->m_aDoors[3].m_fPreviousAngle = vp->door_angles[1] * M_PI / 127.0f; + car->Doors[2].m_fAngle = car->Doors[2].m_fPreviousAngle = vp->door_angles[0] * M_PI / 127.0f; + car->Doors[3].m_fAngle = car->Doors[3].m_fPreviousAngle = vp->door_angles[1] * M_PI / 127.0f; if (vp->door_angles[0]) - car->m_DamageManager.SetDoorStatus(2, 2); + car->Damage.SetDoorStatus(2, 2); if (vp->door_angles[1]) - car->m_DamageManager.SetDoorStatus(3, 2); - if (vp->door_status & 1 && car->m_DamageManager.GetDoorStatus(VEHDOOR_BONNET) != 3){ - car->m_DamageManager.SetDoorStatus(VEHDOOR_BONNET, 3); - car->SetDoorDamage(17, VEHDOOR_BONNET, true); + car->Damage.SetDoorStatus(3, 2); + if (vp->door_status & 1 && car->Damage.GetDoorStatus(DOOR_BONNET) != 3){ + car->Damage.SetDoorStatus(DOOR_BONNET, 3); + car->SetDoorDamage(CAR_BONNET, DOOR_BONNET, true); } - if (vp->door_status & 2 && car->m_DamageManager.GetDoorStatus(VEHDOOR_BOOT) != 3) { - car->m_DamageManager.SetDoorStatus(VEHDOOR_BOOT, 3); - car->SetDoorDamage(18, VEHDOOR_BOOT, true); + if (vp->door_status & 2 && car->Damage.GetDoorStatus(DOOR_BOOT) != 3) { + car->Damage.SetDoorStatus(DOOR_BOOT, 3); + car->SetDoorDamage(CAR_BOOT, DOOR_BOOT, true); } - if (vp->door_status & 4 && car->m_DamageManager.GetDoorStatus(VEHDOOR_FRONT_LEFT) != 3) { - car->m_DamageManager.SetDoorStatus(VEHDOOR_FRONT_LEFT, 3); - car->SetDoorDamage(15, VEHDOOR_FRONT_LEFT, true); + if (vp->door_status & 4 && car->Damage.GetDoorStatus(DOOR_FRONT_LEFT) != 3) { + car->Damage.SetDoorStatus(DOOR_FRONT_LEFT, 3); + car->SetDoorDamage(CAR_DOOR_LF, DOOR_FRONT_LEFT, true); } - if (vp->door_status & 8 && car->m_DamageManager.GetDoorStatus(VEHDOOR_FRONT_RIGHT) != 3) { - car->m_DamageManager.SetDoorStatus(VEHDOOR_FRONT_RIGHT, 3); - car->SetDoorDamage(11, VEHDOOR_FRONT_RIGHT, true); + if (vp->door_status & 8 && car->Damage.GetDoorStatus(DOOR_FRONT_RIGHT) != 3) { + car->Damage.SetDoorStatus(DOOR_FRONT_RIGHT, 3); + car->SetDoorDamage(CAR_DOOR_RF, DOOR_FRONT_RIGHT, true); } - if (vp->door_status & 0x10 && car->m_DamageManager.GetDoorStatus(VEHDOOR_REAR_LEFT) != 3) { - car->m_DamageManager.SetDoorStatus(VEHDOOR_REAR_LEFT, 3); - car->SetDoorDamage(16, VEHDOOR_REAR_LEFT, true); + if (vp->door_status & 0x10 && car->Damage.GetDoorStatus(DOOR_REAR_LEFT) != 3) { + car->Damage.SetDoorStatus(DOOR_REAR_LEFT, 3); + car->SetDoorDamage(CAR_DOOR_LR, DOOR_REAR_LEFT, true); } - if (vp->door_status & 0x20 && car->m_DamageManager.GetDoorStatus(VEHDOOR_REAR_RIGHT) != 3) { - car->m_DamageManager.SetDoorStatus(VEHDOOR_REAR_RIGHT, 3); - car->SetDoorDamage(12, VEHDOOR_REAR_RIGHT, true); + if (vp->door_status & 0x20 && car->Damage.GetDoorStatus(DOOR_REAR_RIGHT) != 3) { + car->Damage.SetDoorStatus(DOOR_REAR_RIGHT, 3); + car->SetDoorDamage(CAR_DOOR_RR, DOOR_REAR_RIGHT, true); } vehicle->bEngineOn = true; if (vehicle->IsCar()) - ((CAutomobile*)vehicle)->m_nDriveWheelsOnGround = 4; + ((CAutomobile*)vehicle)->m_nWheelsOnGround = 4; CWorld::Remove(vehicle); CWorld::Add(vehicle); if (vehicle->IsBoat()) @@ -1185,24 +1185,24 @@ void CReplay::RestoreStuffFromMem(void) vehicle->SetModelIndex(mi); if (mi == MI_DODO){ CAutomobile* dodo = (CAutomobile*)vehicle; - GetFirstObject(dodo->m_apModelNodes[4])->flags = 0; /* TODO: 4 to enum */ + RpAtomicSetFlags(GetFirstObject(dodo->m_aCarNodes[CAR_WHEEL_LF]), 0); CMatrix tmp1; - tmp1.Attach(&dodo->m_apModelNodes[1]->modelling, false); - CMatrix tmp2(&dodo->m_apModelNodes[4]->modelling, false); + tmp1.Attach(RwFrameGetMatrix(dodo->m_aCarNodes[CAR_WHEEL_RF]), false); + CMatrix tmp2(RwFrameGetMatrix(dodo->m_aCarNodes[CAR_WHEEL_LF]), false); *tmp1.GetPosition() += CVector(tmp2.GetPosition()->x + 0.1f, 0.0f, tmp2.GetPosition()->z); tmp1.UpdateRW(); } if (vehicle->IsCar()){ CAutomobile* car = (CAutomobile*)vehicle; - int32 panels = car->m_DamageManager.m_panelStatus; - car->m_DamageManager.m_panelStatus = 0; + int32 panels = car->Damage.m_panelStatus; + car->Damage.m_panelStatus = 0; ApplyPanelDamageToCar(panels, car, true); - car->SetDoorDamage(17, 0, true); /* BONNET */ - car->SetDoorDamage(18, 1, true); /* BUMPER */ - car->SetDoorDamage(15, 2, true); /* DOOR_FRONT_LEFT */ - car->SetDoorDamage(11, 3, true); /* DOOR_FRONT_RIGHT */ - car->SetDoorDamage(16, 4, true); /* DOOR_BACK_LEFT */ - car->SetDoorDamage(12, 5, true); /* DOOR_BACK_RIGHT */ + car->SetDoorDamage(CAR_BONNET, DOOR_BONNET, true); + car->SetDoorDamage(CAR_BOOT, DOOR_BOOT, true); + car->SetDoorDamage(CAR_DOOR_LF, DOOR_FRONT_LEFT, true); + car->SetDoorDamage(CAR_DOOR_RF, DOOR_FRONT_RIGHT, true); + car->SetDoorDamage(CAR_DOOR_LR, DOOR_REAR_LEFT, true); + car->SetDoorDamage(CAR_DOOR_RR, DOOR_REAR_RIGHT, true); } vehicle->m_audioEntityId = DMAudio.CreateEntity(0, vehicle); DMAudio.SetEntityStatus(vehicle->m_audioEntityId, true); diff --git a/src/entities/Automobile.h b/src/entities/Automobile.h index 64e411ce..b6617f4b 100644 --- a/src/entities/Automobile.h +++ b/src/entities/Automobile.h @@ -1,26 +1,61 @@ #pragma once #include "DamageManager.h" -#include "Door.h" -#include "RwHelper.h" #include "Vehicle.h" +struct CDoor +{ + float m_fAngleWhenOpened; + float m_fAngleWhenClosed; + char field_8; + char field_9; + char field_10; + char field_11; + float m_fAngle; + float m_fPreviousAngle; + float m_fAngularVelocity; + CVector m_vecVelocity; +}; + class CAutomobile : public CVehicle { public: // 0x288 - CDamageManager m_DamageManager; - CDoor m_aDoors[6]; - RwFrame *m_apModelNodes[20]; - uint8 stuff1[160]; - float m_afWheelSuspDist[4]; - uint8 stuff2[44]; - float m_afWheelRotation[4]; - uint8 stuff3[200]; + CDamageManager Damage; + CDoor Doors[6]; + RwFrame *m_aCarNodes[NUM_CAR_NODES]; + CColPoint m_aWheelColPoints[4]; + float m_aWheelDist[4]; + float m_aWheelDist_2[4]; + float m_aWheelSkidThing[4]; + int field_49C; + bool m_aWheelSkidmarkMuddy[4]; + bool m_aWheelSkidmarkBloody[4]; + float m_aWheelRotation[4]; + float m_aWheelPosition[4]; + float m_aWheelSpeed[4]; + uint8 stuff3[12]; + uint32 m_nBusDoorTimerEnd; + uint32 m_nBusDoorTimerStart; + float m_aSuspensionRange[4]; + float m_aSuspensionLineLength[4]; + float m_fHeightAboveRoad; + float m_fImprovedHandling; + uint8 stuff6[32]; + CPhysical *m_aGroundPhysical[4]; // physicals touching wheels + CVector m_aGroundOffset[4]; // from ground object to colpoint + CEntity *m_pBlowUpEntity; + float m_weaponThingA; // TODO + float m_weaponThingB; // TODO float m_fCarGunLR; - uint8 stuff4[13]; - uint8 m_nDriveWheelsOnGround; - uint8 stuff5[22]; + float m_fCarGunUD; + float m_fWindScreenRotation; + uint8 stuff4[4]; + uint8 m_nWheelsOnGround_2; + uint8 m_nWheelsOnGround; + uint8 m_nWheelsOnGroundPrev; + uint8 stuff5[5]; + int32 m_aWheelState[4]; CAutomobile(int, uint8); CAutomobile* ctor(int, uint8); @@ -30,4 +65,4 @@ public: void dtor() { this->CAutomobile::~CAutomobile(); } }; static_assert(sizeof(CAutomobile) == 0x5A8, "CAutomobile: error"); -static_assert(offsetof(CAutomobile, m_afWheelSuspDist) == 0x46C, "CAutomobile: error"); +static_assert(offsetof(CAutomobile, m_aWheelDist) == 0x46C, "CAutomobile: error"); diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp index b570efd9..14891cd9 100644 --- a/src/entities/Physical.cpp +++ b/src/entities/Physical.cpp @@ -1858,10 +1858,10 @@ CPhysical::ProcessCollision(void) CVehicle *veh = (CVehicle*)this; if(veh->m_vehType == VEHICLE_TYPE_CAR){ CAutomobile *car = (CAutomobile*)this; - car->m_afWheelSuspDist[0] = 1.0f; - car->m_afWheelSuspDist[1] = 1.0f; - car->m_afWheelSuspDist[2] = 1.0f; - car->m_afWheelSuspDist[3] = 1.0f; + car->m_aWheelDist[0] = 1.0f; + car->m_aWheelDist[1] = 1.0f; + car->m_aWheelDist[2] = 1.0f; + car->m_aWheelDist[3] = 1.0f; }else if(veh->m_vehType == VEHICLE_TYPE_BIKE){ assert(0 && "TODO - but unused"); } diff --git a/src/entities/Vehicle.h b/src/entities/Vehicle.h index eb5275ad..7b9bebef 100644 --- a/src/entities/Vehicle.h +++ b/src/entities/Vehicle.h @@ -14,14 +14,6 @@ enum { PERMANENT_VEHICLE = 4, }; - -enum { - GETTING_IN_OUT_FL = 1, - GETTING_IN_OUT_RL = 2, - GETTING_IN_OUT_FR = 4, - GETTING_IN_OUT_RR = 8 -}; - enum eCarLock { CARLOCK_NOT_USED, CARLOCK_UNLOCKED, @@ -33,82 +25,55 @@ enum eCarLock { CARLOCK_SKIP_SHUT_DOORS }; -// TODO: where is this used? Is Vehicle.h the right file? -enum eVehicleModel + +enum eCarNodes +{ + CAR_WHEEL_RF = 1, + CAR_WHEEL_RM, + CAR_WHEEL_RB, + CAR_WHEEL_LF, + CAR_WHEEL_LM, + CAR_WHEEL_LB, + CAR_BUMP_FRONT, + CAR_BUMP_REAR, + CAR_WING_RF, + CAR_WING_RR, + CAR_DOOR_RF, + CAR_DOOR_RR, + CAR_WING_LF, + CAR_WING_LR, + CAR_DOOR_LF, + CAR_DOOR_LR, + CAR_BONNET, + CAR_BOOT, + CAR_WINDSCREEN, + NUM_CAR_NODES, +}; + +enum +{ + CAR_POS_HEADLIGHTS, + CAR_POS_TAILLIGHTS, + CAR_POS_FRONTSEAT, + CAR_POS_BACKSEAT, + CAR_POS_EXHAUST = 9, +}; + +enum eDoors { - LANDSTAL, - IDAHO, - STINGER, - LINERUN, - PEREN, - SENTINEL, - PATRIOT, - FIRETRUK, - TRASH, - STRETCH, - MANANA, - INFERNUS, - BLISTA, - PONY, - MULE, - CHEETAH, - AMBULAN, - FBICAR, - MOONBEAM, - ESPERANT, - TAXI, - KURUMA, - BOBCAT, - MRWHOOP, - BFINJECT, - CORPSE, - POLICE, - ENFORCER, - SECURICA, - BANSHEE, - PREDATOR, - BUS, - RHINO, - BARRACKS, - TRAIN, - CHOPPER, - DODO, - COACH, - CABBIE, - STALLION, - RUMPO, - RCBANDIT, - BELLYUP, - MRWONGS, - MAFIA, - YARDIE, - YAKUZA, - DIABLOS, - COLUMB, - HOODS, - AIRTRAIN, - DEADDODO, - SPEEDER, - REEFER, - PANLANT, - FLATBED, - YANKEE, - ESCAPE, - BORGNINE, - TOYZ, - GHOST, - CAR151, - CAR152, - CAR153, - CAR154, - CAR155, - CAR156, - CAR157, - CAR158, - CAR159, + DOOR_BONNET = 0, + DOOR_BOOT, + DOOR_FRONT_LEFT, + DOOR_FRONT_RIGHT, + DOOR_REAR_LEFT, + DOOR_REAR_RIGHT }; -enum eDoors { +enum { + GETTING_IN_OUT_FL = 1, + GETTING_IN_OUT_RL = 2, + GETTING_IN_OUT_FR = 4, + GETTING_IN_OUT_RR = 8 }; class CVehicle : public CPhysical diff --git a/src/modelinfo/VehicleModelInfo.cpp b/src/modelinfo/VehicleModelInfo.cpp index 0d206db0..f112d546 100644 --- a/src/modelinfo/VehicleModelInfo.cpp +++ b/src/modelinfo/VehicleModelInfo.cpp @@ -24,34 +24,6 @@ RwTexture *&gpWhiteTexture = *(RwTexture**)0x64C4F8; RwFrame *&pMatFxIdentityFrame = *(RwFrame**)0x64C510; enum { - CAR_WHEEL_RF = 1, - CAR_WHEEL_RM = 2, - CAR_WHEEL_RB = 3, - CAR_WHEEL_LF = 4, - CAR_WHEEL_LM = 5, - CAR_WHEEL_LB = 6, - CAR_BUMP_FRONT = 7, - CAR_BUMP_REAR = 8, - CAR_WING_RF = 9, - CAR_WING_RR = 10, - CAR_DOOR_RF = 11, - CAR_DOOR_RR = 12, - CAR_WING_LF = 13, - CAR_WING_LR = 14, - CAR_DOOR_LF = 15, - CAR_DOOR_LR = 16, - CAR_BONNET = 17, - CAR_BOOT = 18, - CAR_WINDSCREEN = 19, - - CAR_POS_HEADLIGHTS = 0, - CAR_POS_TAILLIGHTS = 1, - CAR_POS_FRONTSEAT = 2, - CAR_POS_BACKSEAT = 3, - CAR_POS_EXHAUST = 9, -}; - -enum { VEHICLE_FLAG_COLLAPSE = 0x2, VEHICLE_FLAG_ADD_WHEEL = 0x4, VEHICLE_FLAG_POS = 0x8, |