diff options
Diffstat (limited to 'src/engine/vehicles')
| -rw-r--r-- | src/engine/vehicles/Boat.cpp | 25 | ||||
| -rw-r--r-- | src/engine/vehicles/Boat.h | 9 | ||||
| -rw-r--r-- | src/engine/vehicles/Bus.cpp | 25 | ||||
| -rw-r--r-- | src/engine/vehicles/Bus.h | 7 | ||||
| -rw-r--r-- | src/engine/vehicles/Car.cpp | 27 | ||||
| -rw-r--r-- | src/engine/vehicles/Car.h | 8 | ||||
| -rw-r--r-- | src/engine/vehicles/TankerTruck.cpp | 25 | ||||
| -rw-r--r-- | src/engine/vehicles/TankerTruck.h | 7 | ||||
| -rw-r--r-- | src/engine/vehicles/Train.cpp | 57 | ||||
| -rw-r--r-- | src/engine/vehicles/Train.h | 7 | ||||
| -rw-r--r-- | src/engine/vehicles/Truck.cpp | 25 | ||||
| -rw-r--r-- | src/engine/vehicles/Truck.h | 7 | ||||
| -rw-r--r-- | src/engine/vehicles/Utils.cpp | 2 |
13 files changed, 91 insertions, 140 deletions
diff --git a/src/engine/vehicles/Boat.cpp b/src/engine/vehicles/Boat.cpp index 073974581..1e3ba1737 100644 --- a/src/engine/vehicles/Boat.cpp +++ b/src/engine/vehicles/Boat.cpp @@ -44,21 +44,17 @@ ABoat::ABoat(f32 speed, u32 waypoint) { if (IsActive == 1) { f32 origXPos = Position[0]; f32 origZPos = Position[2]; - RotY = update_vehicle_following_waypoint( - Position, (s16*) &WaypointIndex, - Speed); + RotY = update_vehicle_following_waypoint(Position, (s16*) &WaypointIndex, Speed); Velocity[0] = Position[0] - origXPos; Velocity[2] = Position[2] - origZPos; vec3s_set(paddleWheelBoatRot, 0, RotY, 0); - ActorIndex = add_actor_to_empty_slot(Position, paddleWheelBoatRot, - Velocity, ACTOR_PADDLE_BOAT); + ActorIndex = add_actor_to_empty_slot(Position, paddleWheelBoatRot, Velocity, ACTOR_PADDLE_BOAT); } _count++; } void ABoat::Draw(Camera* camera) { - } bool ABoat::IsMod() { @@ -84,22 +80,20 @@ void ABoat::Tick() { temp_f26 = Position[0]; temp_f28 = Position[1]; temp_f30 = Position[2]; - update_vehicle_following_waypoint(Position, (s16*) &WaypointIndex, - Speed); - SomeFlags = set_vehicle_render_distance_flags(Position, BOAT_SMOKE_RENDER_DISTANCE, - SomeFlags); + update_vehicle_following_waypoint(Position, (s16*) &WaypointIndex, Speed); + SomeFlags = set_vehicle_render_distance_flags(Position, BOAT_SMOKE_RENDER_DISTANCE, SomeFlags); if ((((s16) AnotherSmokeTimer % 10) == 0) && (SomeFlags != 0)) { smokePos[0] = (f32) ((f64) Position[0] - 30.0); smokePos[1] = (f32) ((f64) Position[1] + 180.0); smokePos[2] = (f32) ((f64) Position[2] + 45.0); adjust_position_by_angle(smokePos, Position, RotY); - //spawn_ferry_smoke(Index, smokePos, 1.1f); + // spawn_ferry_smoke(Index, smokePos, 1.1f); AddSmoke(Index, smokePos, 1.1f); smokePos[0] = (f32) ((f64) Position[0] + 30.0); smokePos[1] = (f32) ((f64) Position[1] + 180.0); smokePos[2] = (f32) ((f64) Position[2] + 45.0); adjust_position_by_angle(smokePos, Position, RotY); - //spawn_ferry_smoke(Index, smokePos, 1.1f); + // spawn_ferry_smoke(Index, smokePos, 1.1f); AddSmoke(Index, smokePos, 1.1f); } if (random_int(100) == 0) { @@ -182,9 +176,8 @@ void ABoat::VehicleCollision(s32 playerId, Player* player) { z_diff = playerZ - Position[2]; if ((x_diff > -300.0) && (x_diff < 300.0)) { if ((z_diff > -300.0) && (z_diff < 300.0)) { - if ((func_80006018(Position[0], Position[2], - Velocity[0], Velocity[2], 200.0f, - 60.0f, playerX, playerZ) == 1) && + if ((func_80006018(Position[0], Position[2], Velocity[0], Velocity[2], 200.0f, 60.0f, playerX, + playerZ) == 1) && (y_diff < 60.0)) { player->soundEffects |= 0x80000; } @@ -201,4 +194,4 @@ s32 ABoat::AddSmoke(size_t ferryIndex, Vec3f pos, f32 velocity) { } return objectIndex; -}
\ No newline at end of file +} diff --git a/src/engine/vehicles/Boat.h b/src/engine/vehicles/Boat.h index dcdd89977..cca015d8c 100644 --- a/src/engine/vehicles/Boat.h +++ b/src/engine/vehicles/Boat.h @@ -10,8 +10,7 @@ extern "C" { } class ABoat : public AActor { - public: - + public: const char* Type = "mk:boat"; size_t Index; bool IsActive; // The paddle wheel boat only shows up if the number of players is < 3 @@ -43,7 +42,7 @@ class ABoat : public AActor { virtual void VehicleCollision(s32 playerId, Player* player) override; virtual s32 AddSmoke(size_t, Vec3f, f32); virtual bool IsMod() override; -private: - static size_t _count; -};
\ No newline at end of file + private: + static size_t _count; +}; diff --git a/src/engine/vehicles/Bus.cpp b/src/engine/vehicles/Bus.cpp index c58cd0a6c..c22391fb1 100644 --- a/src/engine/vehicles/Bus.cpp +++ b/src/engine/vehicles/Bus.cpp @@ -50,16 +50,13 @@ ABus::ABus(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint) { Rotation[0] = 0; Rotation[2] = 0; if (D_8016347A == 0) { - Rotation[1] = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0, 3); + Rotation[1] = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0, 3); } else { - Rotation[1] = - func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); + Rotation[1] = func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); } D_801631C8 = 10; - spawn_vehicle_on_road(Position, Rotation, Velocity, WaypointIndex, SomeMultiplierTheSequel, - Speed); + spawn_vehicle_on_road(Position, Rotation, Velocity, WaypointIndex, SomeMultiplierTheSequel, Speed); ActorIndex = add_actor_to_empty_slot(Position, Rotation, Velocity, ACTOR_SCHOOL_BUS); _count++; @@ -119,11 +116,9 @@ void ABus::Tick() { } } if (D_8016347A == 0) { - var_a1 = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0, 3); + var_a1 = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0, 3); } else { - var_a1 = func_8000D940(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0); + var_a1 = func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); } adjust_angle(&Rotation[1], var_a1, 100); temp_f0_3 = Position[0] - sp5C; @@ -176,8 +171,8 @@ void ABus::VehicleCollision(s32 playerId, Player* player) { if ((temp_f22 > -20.0) && (temp_f22 < 20.0)) { if (((temp_f14) > -100.0) && ((temp_f14) < 100.0)) { - if (func_80006018(Position[0], Position[2], Velocity[0], - Velocity[2], SomeArg3, SomeArg4, spC4, spBC) == (s32) 1) { + if (func_80006018(Position[0], Position[2], Velocity[0], Velocity[2], SomeArg3, SomeArg4, spC4, + spBC) == (s32) 1) { player->soundEffects |= REVERSE_SOUND_EFFECT; } } @@ -212,8 +207,7 @@ void ABus::VehicleCollision(s32 playerId, Player* player) { switch (D_8016347A) { case 0: - t1 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 10, 0, - path); + t1 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 10, 0, path); if ((D_80163270[playerId] == 0) && (t1 > 0) && (player->unk_094 < Speed)) { var_s1 = 1; } @@ -222,8 +216,7 @@ void ABus::VehicleCollision(s32 playerId, Player* player) { } break; case 1: - t2 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 0, 10, - path); + t2 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 0, 10, path); if (t2 > 0) { if (random_int(2) == 0) { // temp_v1_2 = D_80163270[playerId]; diff --git a/src/engine/vehicles/Bus.h b/src/engine/vehicles/Bus.h index c7f3f475e..dd6752775 100644 --- a/src/engine/vehicles/Bus.h +++ b/src/engine/vehicles/Bus.h @@ -12,8 +12,7 @@ extern "C" { } class ABus : public AActor { - public: - + public: const char* Type; size_t Index; f32 Speed; @@ -46,6 +45,6 @@ class ABus : public AActor { virtual void VehicleCollision(s32 playerId, Player* player) override; virtual bool IsMod() override; -private: + private: static size_t _count; -};
\ No newline at end of file +}; diff --git a/src/engine/vehicles/Car.cpp b/src/engine/vehicles/Car.cpp index 89409df50..577c283c5 100644 --- a/src/engine/vehicles/Car.cpp +++ b/src/engine/vehicles/Car.cpp @@ -50,16 +50,13 @@ ACar::ACar(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint) { Rotation[0] = 0; Rotation[2] = 0; if (D_8016347A == 0) { - Rotation[1] = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0, 3); + Rotation[1] = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0, 3); } else { - Rotation[1] = - func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); + Rotation[1] = func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); } D_801631C8 = 10; - spawn_vehicle_on_road(Position, Rotation, Velocity, WaypointIndex, SomeMultiplierTheSequel, - Speed); + spawn_vehicle_on_road(Position, Rotation, Velocity, WaypointIndex, SomeMultiplierTheSequel, Speed); ActorIndex = add_actor_to_empty_slot(Position, Rotation, Velocity, ACTOR_CAR); _count++; @@ -101,11 +98,9 @@ void ACar::Tick() { } } if (D_8016347A == 0) { - var_a1 = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0, 3); + var_a1 = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0, 3); } else { - var_a1 = func_8000D940(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0); + var_a1 = func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); } adjust_angle(&Rotation[1], var_a1, 100); temp_f0_3 = Position[0] - sp5C; @@ -176,8 +171,8 @@ void ACar::VehicleCollision(s32 playerId, Player* player) { if ((temp_f22 > -20.0) && (temp_f22 < 20.0)) { if (((temp_f14) > -100.0) && ((temp_f14) < 100.0)) { - if (func_80006018(Position[0], Position[2], Velocity[0], - Velocity[2], SomeArg3, SomeArg4, spC4, spBC) == (s32) 1) { + if (func_80006018(Position[0], Position[2], Velocity[0], Velocity[2], SomeArg3, SomeArg4, spC4, + spBC) == (s32) 1) { player->soundEffects |= REVERSE_SOUND_EFFECT; } } @@ -212,8 +207,7 @@ void ACar::VehicleCollision(s32 playerId, Player* player) { switch (D_8016347A) { case 0: - t1 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 10, 0, - path); + t1 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 10, 0, path); if ((D_80163270[playerId] == 0) && (t1 > 0) && (player->unk_094 < Speed)) { var_s1 = 1; } @@ -222,8 +216,7 @@ void ACar::VehicleCollision(s32 playerId, Player* player) { } break; case 1: - t2 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 0, 10, - path); + t2 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 0, 10, path); if (t2 > 0) { if (random_int(2) == 0) { // temp_v1_2 = D_80163270[playerId]; @@ -283,4 +276,4 @@ void ACar::VehicleCollision(s32 playerId, Player* player) { } } } -}
\ No newline at end of file +} diff --git a/src/engine/vehicles/Car.h b/src/engine/vehicles/Car.h index 97bd47e2e..594420429 100644 --- a/src/engine/vehicles/Car.h +++ b/src/engine/vehicles/Car.h @@ -12,8 +12,7 @@ extern "C" { } class ACar : public AActor { - public: - + public: explicit ACar(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint); ~ACar() { @@ -45,6 +44,7 @@ class ACar : public AActor { virtual void Draw(Camera*) override; virtual void VehicleCollision(s32 playerId, Player* player) override; virtual bool IsMod() override; -private: + + private: static size_t _count; -};
\ No newline at end of file +}; diff --git a/src/engine/vehicles/TankerTruck.cpp b/src/engine/vehicles/TankerTruck.cpp index 02cd9553b..f3ed9707e 100644 --- a/src/engine/vehicles/TankerTruck.cpp +++ b/src/engine/vehicles/TankerTruck.cpp @@ -50,16 +50,13 @@ ATankerTruck::ATankerTruck(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t Rotation[0] = 0; Rotation[2] = 0; if (D_8016347A == 0) { - Rotation[1] = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0, 3); + Rotation[1] = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0, 3); } else { - Rotation[1] = - func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); + Rotation[1] = func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); } D_801631C8 = 10; - spawn_vehicle_on_road(Position, Rotation, Velocity, WaypointIndex, SomeMultiplierTheSequel, - Speed); + spawn_vehicle_on_road(Position, Rotation, Velocity, WaypointIndex, SomeMultiplierTheSequel, Speed); ActorIndex = add_actor_to_empty_slot(Position, Rotation, Velocity, ACTOR_TANKER_TRUCK); _count++; @@ -119,11 +116,9 @@ void ATankerTruck::Tick() { } } if (D_8016347A == 0) { - var_a1 = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0, 3); + var_a1 = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0, 3); } else { - var_a1 = func_8000D940(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0); + var_a1 = func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); } adjust_angle(&Rotation[1], var_a1, 100); temp_f0_3 = Position[0] - sp5C; @@ -176,8 +171,8 @@ void ATankerTruck::VehicleCollision(s32 playerId, Player* player) { if ((temp_f22 > -20.0) && (temp_f22 < 20.0)) { if (((temp_f14) > -100.0) && ((temp_f14) < 100.0)) { - if (func_80006018(Position[0], Position[2], Velocity[0], - Velocity[2], SomeArg3, SomeArg4, spC4, spBC) == (s32) 1) { + if (func_80006018(Position[0], Position[2], Velocity[0], Velocity[2], SomeArg3, SomeArg4, spC4, + spBC) == (s32) 1) { player->soundEffects |= REVERSE_SOUND_EFFECT; } } @@ -212,8 +207,7 @@ void ATankerTruck::VehicleCollision(s32 playerId, Player* player) { switch (D_8016347A) { case 0: - t1 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 10, 0, - path); + t1 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 10, 0, path); if ((D_80163270[playerId] == 0) && (t1 > 0) && (player->unk_094 < Speed)) { var_s1 = 1; } @@ -222,8 +216,7 @@ void ATankerTruck::VehicleCollision(s32 playerId, Player* player) { } break; case 1: - t2 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 0, 10, - path); + t2 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 0, 10, path); if (t2 > 0) { if (random_int(2) == 0) { // temp_v1_2 = D_80163270[playerId]; diff --git a/src/engine/vehicles/TankerTruck.h b/src/engine/vehicles/TankerTruck.h index e109115a9..f587783d0 100644 --- a/src/engine/vehicles/TankerTruck.h +++ b/src/engine/vehicles/TankerTruck.h @@ -12,8 +12,7 @@ extern "C" { } class ATankerTruck : public AActor { - public: - + public: const char* Type; size_t Index; f32 Speed; @@ -46,6 +45,6 @@ class ATankerTruck : public AActor { virtual void VehicleCollision(s32 playerId, Player* player) override; virtual bool IsMod() override; -private: + private: static size_t _count; -};
\ No newline at end of file +}; diff --git a/src/engine/vehicles/Train.cpp b/src/engine/vehicles/Train.cpp index a3952742d..e34fc12ea 100644 --- a/src/engine/vehicles/Train.cpp +++ b/src/engine/vehicles/Train.cpp @@ -19,7 +19,7 @@ extern "C" { #include "math_util_2.h" #include "render_objects.h" #include "assets/common_data.h" - // #include "common_structs.h" +// #include "common_structs.h" } size_t ATrain::_count = 0; @@ -88,25 +88,25 @@ ATrain::ATrain(ATrain::TenderStatus tender, size_t numCarriages, f32 speed, uint tempLocomotive = &Locomotive; origXPos = tempLocomotive->position[0]; origZPos = tempLocomotive->position[2]; - trainCarYRot = update_vehicle_following_waypoint( - tempLocomotive->position, (s16*) &tempLocomotive->waypointIndex, Speed); + trainCarYRot = + update_vehicle_following_waypoint(tempLocomotive->position, (s16*) &tempLocomotive->waypointIndex, Speed); tempLocomotive->velocity[0] = tempLocomotive->position[0] - origXPos; tempLocomotive->velocity[2] = tempLocomotive->position[2] - origZPos; vec3s_set(trainCarRot, 0, trainCarYRot, 0); - tempLocomotive->actorIndex = add_actor_to_empty_slot(tempLocomotive->position, trainCarRot, - tempLocomotive->velocity, ACTOR_TRAIN_ENGINE); + tempLocomotive->actorIndex = + add_actor_to_empty_slot(tempLocomotive->position, trainCarRot, tempLocomotive->velocity, ACTOR_TRAIN_ENGINE); tempTender = &Tender; if (tempTender->isActive == 1) { origXPos = tempTender->position[0]; origZPos = tempTender->position[2]; - trainCarYRot = update_vehicle_following_waypoint( - tempTender->position, (s16*) &tempTender->waypointIndex, Speed); + trainCarYRot = + update_vehicle_following_waypoint(tempTender->position, (s16*) &tempTender->waypointIndex, Speed); tempTender->velocity[0] = tempTender->position[0] - origXPos; tempTender->velocity[2] = tempTender->position[2] - origZPos; vec3s_set(trainCarRot, 0, trainCarYRot, 0); - tempTender->actorIndex = add_actor_to_empty_slot(tempTender->position, trainCarRot, - tempTender->velocity, ACTOR_TRAIN_TENDER); + tempTender->actorIndex = + add_actor_to_empty_slot(tempTender->position, trainCarRot, tempTender->velocity, ACTOR_TRAIN_TENDER); } for (size_t i = 0; i < PassengerCars.size(); i++) { @@ -115,14 +115,12 @@ ATrain::ATrain(ATrain::TenderStatus tender, size_t numCarriages, f32 speed, uint origXPos = tempPassengerCar->position[0]; origZPos = tempPassengerCar->position[2]; trainCarYRot = update_vehicle_following_waypoint(tempPassengerCar->position, - (s16*) &tempPassengerCar->waypointIndex, - Speed); + (s16*) &tempPassengerCar->waypointIndex, Speed); tempPassengerCar->velocity[0] = tempPassengerCar->position[0] - origXPos; tempPassengerCar->velocity[2] = tempPassengerCar->position[2] - origZPos; vec3s_set(trainCarRot, 0, trainCarYRot, 0); - tempPassengerCar->actorIndex = - add_actor_to_empty_slot(tempPassengerCar->position, trainCarRot, tempPassengerCar->velocity, - ACTOR_TRAIN_PASSENGER_CAR); + tempPassengerCar->actorIndex = add_actor_to_empty_slot( + tempPassengerCar->position, trainCarRot, tempPassengerCar->velocity, ACTOR_TRAIN_PASSENGER_CAR); } } @@ -166,8 +164,8 @@ void ATrain::Tick() { temp_f20 = Locomotive.position[0]; temp_f22 = Locomotive.position[2]; - orientationYUpdate = update_vehicle_following_waypoint( - Locomotive.position, (s16*) &Locomotive.waypointIndex, Speed); + orientationYUpdate = + update_vehicle_following_waypoint(Locomotive.position, (s16*) &Locomotive.waypointIndex, Speed); Locomotive.velocity[0] = Locomotive.position[0] - temp_f20; Locomotive.velocity[2] = Locomotive.position[2] - temp_f22; @@ -175,24 +173,20 @@ void ATrain::Tick() { sync_train_components(&Locomotive, orientationYUpdate); if ((oldWaypointIndex != Locomotive.waypointIndex) && - ((Locomotive.waypointIndex == 0x00BE) || - (Locomotive.waypointIndex == 0x0140))) { // play crossing bell sound - func_800C98B8(Locomotive.position, Locomotive.velocity, - SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x0E)); + ((Locomotive.waypointIndex == 0x00BE) || (Locomotive.waypointIndex == 0x0140))) { // play crossing bell sound + func_800C98B8(Locomotive.position, Locomotive.velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x0E)); } else if (random_int(100) == 0) { // play train whistle sound - func_800C98B8(Locomotive.position, Locomotive.velocity, - SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x0D)); + func_800C98B8(Locomotive.position, Locomotive.velocity, SOUND_ARG_LOAD(0x19, 0x01, 0x80, 0x0D)); } - SomeFlags = set_vehicle_render_distance_flags( - Locomotive.position, TRAIN_SMOKE_RENDER_DISTANCE, SomeFlags); + SomeFlags = set_vehicle_render_distance_flags(Locomotive.position, TRAIN_SMOKE_RENDER_DISTANCE, SomeFlags); // Renders locomotive smoke on all screens if any player is within range. if ((((s16) AnotherSmokeTimer % 5) == 0) && (SomeFlags != 0)) { smokePos[0] = Locomotive.position[0]; smokePos[1] = (f32) ((f64) Locomotive.position[1] + 65.0); smokePos[2] = (f32) ((f64) Locomotive.position[2] + 25.0); adjust_position_by_angle(smokePos, Locomotive.position, orientationYUpdate); - //spawn_train_smoke(Index, smokePos, 1.1f); + // spawn_train_smoke(Index, smokePos, 1.1f); AddSmoke(Index, smokePos, 1.1f); } @@ -201,8 +195,7 @@ void ATrain::Tick() { if (car->isActive == 1) { temp_f20 = car->position[0]; temp_f22 = car->position[2]; - orientationYUpdate = - update_vehicle_following_waypoint(car->position, (s16*) &car->waypointIndex, Speed); + orientationYUpdate = update_vehicle_following_waypoint(car->position, (s16*) &car->waypointIndex, Speed); car->velocity[0] = car->position[0] - temp_f20; car->velocity[2] = car->position[2] - temp_f22; sync_train_components(car, orientationYUpdate); @@ -214,8 +207,7 @@ void ATrain::Tick() { temp_f20 = car->position[0]; temp_f22 = car->position[2]; - orientationYUpdate = - update_vehicle_following_waypoint(car->position, (s16*) &car->waypointIndex, Speed); + orientationYUpdate = update_vehicle_following_waypoint(car->position, (s16*) &car->waypointIndex, Speed); car->velocity[0] = car->position[0] - temp_f20; car->velocity[2] = car->position[2] - temp_f22; sync_train_components(car, orientationYUpdate); @@ -241,13 +233,13 @@ void ATrain::VehicleCollision(s32 playerId, Player* player) { if ((x_dist > -100.0) && (x_dist < 100.0)) { if ((z_dist > -100.0) && (z_dist < 100.0)) { if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], - trainCar->velocity[2], 60.0f, 20.0f, playerPosX, playerPosZ) == 1) { + trainCar->velocity[2], 60.0f, 20.0f, playerPosX, playerPosZ) == 1) { player->soundEffects |= REVERSE_SOUND_EFFECT; } trainCar = &Tender; if (trainCar->isActive == 1) { if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], - trainCar->velocity[2], 30.0f, 20.0f, playerPosX, playerPosZ) == 1) { + trainCar->velocity[2], 30.0f, 20.0f, playerPosX, playerPosZ) == 1) { player->soundEffects |= REVERSE_SOUND_EFFECT; } } @@ -262,7 +254,7 @@ void ATrain::VehicleCollision(s32 playerId, Player* player) { if ((x_dist > -100.0) && (x_dist < 100.0)) { if ((z_dist > -100.0) && (z_dist < 100.0)) { if (func_80006018(trainCar->position[0], trainCar->position[2], trainCar->velocity[0], - trainCar->velocity[2], 30.0f, 20.0f, playerPosX, playerPosZ) == 1) { + trainCar->velocity[2], 30.0f, 20.0f, playerPosX, playerPosZ) == 1) { player->soundEffects |= REVERSE_SOUND_EFFECT; } } @@ -273,7 +265,6 @@ void ATrain::VehicleCollision(s32 playerId, Player* player) { } } - void ATrain::Draw(Camera* camera) { } diff --git a/src/engine/vehicles/Train.h b/src/engine/vehicles/Train.h index b5100586e..d939a7028 100644 --- a/src/engine/vehicles/Train.h +++ b/src/engine/vehicles/Train.h @@ -14,8 +14,7 @@ extern "C" { * @arg waypoint initial waypoint to spawn at. */ class ATrain : public AActor { - public: - + public: enum TenderStatus { NO_TENDER, HAS_TENDER, @@ -54,6 +53,6 @@ class ATrain : public AActor { s32 AddSmoke(s32 trainIndex, Vec3f pos, f32 velocity); void SyncComponents(TrainCarStuff* trainCar, s16 orientationY); -private: + private: static size_t _count; -};
\ No newline at end of file +}; diff --git a/src/engine/vehicles/Truck.cpp b/src/engine/vehicles/Truck.cpp index 585293489..ae1df36a5 100644 --- a/src/engine/vehicles/Truck.cpp +++ b/src/engine/vehicles/Truck.cpp @@ -50,16 +50,13 @@ ATruck::ATruck(f32 speedA, f32 speedB, TrackWaypoint* path, uint32_t waypoint) { Rotation[0] = 0; Rotation[2] = 0; if (D_8016347A == 0) { - Rotation[1] = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0, 3); + Rotation[1] = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0, 3); } else { - Rotation[1] = - func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); + Rotation[1] = func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); } D_801631C8 = 10; - spawn_vehicle_on_road(Position, Rotation, Velocity, WaypointIndex, SomeMultiplierTheSequel, - Speed); + spawn_vehicle_on_road(Position, Rotation, Velocity, WaypointIndex, SomeMultiplierTheSequel, Speed); ActorIndex = add_actor_to_empty_slot(Position, Rotation, Velocity, ACTOR_BOX_TRUCK); _count++; @@ -119,11 +116,9 @@ void ATruck::Tick() { } } if (D_8016347A == 0) { - var_a1 = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0, 3); + var_a1 = func_8000D6D0(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0, 3); } else { - var_a1 = func_8000D940(Position, (s16*) &WaypointIndex, Speed, - SomeMultiplierTheSequel, 0); + var_a1 = func_8000D940(Position, (s16*) &WaypointIndex, Speed, SomeMultiplierTheSequel, 0); } adjust_angle(&Rotation[1], var_a1, 100); temp_f0_3 = Position[0] - sp5C; @@ -176,8 +171,8 @@ void ATruck::VehicleCollision(s32 playerId, Player* player) { if ((temp_f22 > -20.0) && (temp_f22 < 20.0)) { if (((temp_f14) > -100.0) && ((temp_f14) < 100.0)) { - if (func_80006018(Position[0], Position[2], Velocity[0], - Velocity[2], SomeArg3, SomeArg4, spC4, spBC) == (s32) 1) { + if (func_80006018(Position[0], Position[2], Velocity[0], Velocity[2], SomeArg3, SomeArg4, spC4, + spBC) == (s32) 1) { player->soundEffects |= REVERSE_SOUND_EFFECT; } } @@ -212,8 +207,7 @@ void ATruck::VehicleCollision(s32 playerId, Player* player) { switch (D_8016347A) { case 0: - t1 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 10, 0, - path); + t1 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 10, 0, path); if ((D_80163270[playerId] == 0) && (t1 > 0) && (player->unk_094 < Speed)) { var_s1 = 1; } @@ -222,8 +216,7 @@ void ATruck::VehicleCollision(s32 playerId, Player* player) { } break; case 1: - t2 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 0, 10, - path); + t2 = func_80007BF8(WaypointIndex, gNearestWaypointByPlayerId[playerId], 0, 10, path); if (t2 > 0) { if (random_int(2) == 0) { // temp_v1_2 = D_80163270[playerId]; diff --git a/src/engine/vehicles/Truck.h b/src/engine/vehicles/Truck.h index c18ce86a5..683c1068b 100644 --- a/src/engine/vehicles/Truck.h +++ b/src/engine/vehicles/Truck.h @@ -12,8 +12,7 @@ extern "C" { } class ATruck : public AActor { - public: - + public: const char* Type; size_t Index; f32 Speed; @@ -46,6 +45,6 @@ class ATruck : public AActor { virtual void VehicleCollision(s32 playerId, Player* player) override; virtual bool IsMod() override; -private: + private: static size_t _count; -};
\ No newline at end of file +}; diff --git a/src/engine/vehicles/Utils.cpp b/src/engine/vehicles/Utils.cpp index d2a3ece57..f51479587 100644 --- a/src/engine/vehicles/Utils.cpp +++ b/src/engine/vehicles/Utils.cpp @@ -8,5 +8,5 @@ extern "C" { } uint32_t CalculateWaypointDistribution(size_t i, uint32_t numVehicles, size_t numWaypoints, uint32_t centerWaypoint) { - return (uint32_t)(((i * numWaypoints) / numVehicles) + centerWaypoint) % numWaypoints; + return (uint32_t) (((i * numWaypoints) / numVehicles) + centerWaypoint) % numWaypoints; } |
