mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-23 06:44:38 +01:00
Merge pull request #11257 from hdpoliveira/vehicle_update_9473
Part of #9473: Convert cable_lift_update to Vehicle private method Ca…
This commit is contained in:
@@ -88,27 +88,27 @@ Vehicle* cable_lift_segment_create(
|
||||
return current;
|
||||
}
|
||||
|
||||
void cable_lift_update(Vehicle* vehicle)
|
||||
void Vehicle::CableLiftUpdate()
|
||||
{
|
||||
switch (vehicle->status)
|
||||
switch (status)
|
||||
{
|
||||
case VEHICLE_STATUS_MOVING_TO_END_OF_STATION:
|
||||
cable_lift_update_moving_to_end_of_station(vehicle);
|
||||
cable_lift_update_moving_to_end_of_station(this);
|
||||
break;
|
||||
case VEHICLE_STATUS_WAITING_FOR_PASSENGERS:
|
||||
// Stays in this state until a train puts it into next state
|
||||
break;
|
||||
case VEHICLE_STATUS_WAITING_TO_DEPART:
|
||||
cable_lift_update_waiting_to_depart(vehicle);
|
||||
cable_lift_update_waiting_to_depart(this);
|
||||
break;
|
||||
case VEHICLE_STATUS_DEPARTING:
|
||||
cable_lift_update_departing(vehicle);
|
||||
cable_lift_update_departing(this);
|
||||
break;
|
||||
case VEHICLE_STATUS_TRAVELLING:
|
||||
cable_lift_update_travelling(vehicle);
|
||||
cable_lift_update_travelling(this);
|
||||
break;
|
||||
case VEHICLE_STATUS_ARRIVING:
|
||||
cable_lift_update_arriving(vehicle);
|
||||
cable_lift_update_arriving(this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
|
||||
Vehicle* cable_lift_segment_create(
|
||||
Ride& ride, int32_t x, int32_t y, int32_t z, int32_t direction, uint16_t var_44, int32_t remaining_distance, bool head);
|
||||
void cable_lift_update(Vehicle* vehicle);
|
||||
int32_t cable_lift_update_track_motion(Vehicle* cableLift);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4743,7 +4743,7 @@ static bool ride_create_vehicles(Ride* ride, CoordsXYE* element, int32_t isApply
|
||||
|
||||
if (!(vehicleEntry->flags & VEHICLE_ENTRY_FLAG_DODGEM_CAR_PLACEMENT))
|
||||
{
|
||||
vehicle_update_track_motion(vehicle, nullptr);
|
||||
vehicle->UpdateTrackMotion(nullptr);
|
||||
}
|
||||
|
||||
vehicle_unset_update_flag_b1(vehicle);
|
||||
@@ -4771,12 +4771,12 @@ void loc_6DDF9C(Ride* ride, TileElement* tileElement)
|
||||
train = GET_VEHICLE(vehicleSpriteIdx);
|
||||
if (i == 0)
|
||||
{
|
||||
vehicle_update_track_motion(train, nullptr);
|
||||
train->UpdateTrackMotion(nullptr);
|
||||
vehicle_unset_update_flag_b1(train);
|
||||
continue;
|
||||
}
|
||||
|
||||
vehicle_update_track_motion(train, nullptr);
|
||||
train->UpdateTrackMotion(nullptr);
|
||||
|
||||
do
|
||||
{
|
||||
@@ -4796,7 +4796,7 @@ void loc_6DDF9C(Ride* ride, TileElement* tileElement)
|
||||
}
|
||||
car = GET_VEHICLE(spriteIndex);
|
||||
}
|
||||
} while (!(vehicle_update_track_motion(train, nullptr) & VEHICLE_UPDATE_MOTION_TRACK_FLAG_10));
|
||||
} while (!(train->UpdateTrackMotion(nullptr) & VEHICLE_UPDATE_MOTION_TRACK_FLAG_10));
|
||||
|
||||
tileElement->AsTrack()->SetBlockBrakeClosed(true);
|
||||
car = train;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -176,6 +176,9 @@ enum VEHICLE_TRACK_SUBPOSITION : uint8_t
|
||||
VEHICLE_TRACK_SUBPOSITION_REVERSER_RC_REAR_BOGIE,
|
||||
};
|
||||
|
||||
struct Ride;
|
||||
struct rct_ride_entry;
|
||||
|
||||
struct Vehicle : SpriteBase
|
||||
{
|
||||
uint8_t vehicle_sprite_type;
|
||||
@@ -302,11 +305,51 @@ struct Vehicle : SpriteBase
|
||||
void SetState(VEHICLE_STATUS vehicleStatus, uint8_t subState = 0);
|
||||
bool IsGhost() const;
|
||||
void UpdateSoundParams(std::vector<rct_vehicle_sound_params>& vehicleSoundParamsList) const;
|
||||
int32_t UpdateTrackMotion(int32_t* outStation);
|
||||
|
||||
private:
|
||||
bool SoundCanPlay() const;
|
||||
uint16_t GetSoundPriority() const;
|
||||
rct_vehicle_sound_params CreateSoundParam(uint16_t priority) const;
|
||||
void CableLiftUpdate();
|
||||
void UpdateMovingToEndOfStation();
|
||||
void UpdateWaitingForPassengers();
|
||||
void UpdateWaitingToDepart();
|
||||
void UpdateCrash();
|
||||
void UpdateDodgemsMode();
|
||||
void UpdateSwinging();
|
||||
void UpdateSimulatorOperating();
|
||||
void UpdateTopSpinOperating();
|
||||
void UpdateFerrisWheelRotating();
|
||||
void UpdateSpaceRingsOperating();
|
||||
void UpdateHauntedHouseOperating();
|
||||
void UpdateCrookedHouseOperating();
|
||||
void UpdateRotating();
|
||||
void UpdateDeparting();
|
||||
void FinishDeparting();
|
||||
void UpdateTravelling();
|
||||
void UpdateTravellingCableLift();
|
||||
void UpdateTravellingBoat();
|
||||
void UpdateMotionBoatHire();
|
||||
void UpdateDepartingBoatHire();
|
||||
void UpdateTravellingBoatHireSetup();
|
||||
void UpdateBoatLocation();
|
||||
void UpdateArriving();
|
||||
void UpdateUnloadingPassengers();
|
||||
void UpdateWaitingForCableLift();
|
||||
void UpdateShowingFilm();
|
||||
void UpdateDoingCircusShow();
|
||||
void UpdateCrossings() const;
|
||||
void UpdateSound();
|
||||
SoundId UpdateScreamSound();
|
||||
void UpdateCrashSetup();
|
||||
void UpdateCollisionSetup();
|
||||
int32_t UpdateMotionDodgems();
|
||||
void UpdateAdditionalAnimation();
|
||||
void CheckIfMissing();
|
||||
bool CurrentTowerElementIsTop();
|
||||
bool UpdateTrackMotionForwards(rct_ride_entry_vehicle* vehicleEntry, Ride* curRide, rct_ride_entry* rideEntry);
|
||||
bool UpdateTrackMotionBackwards(rct_ride_entry_vehicle* vehicleEntry, Ride* curRide, rct_ride_entry* rideEntry);
|
||||
};
|
||||
|
||||
struct train_ref
|
||||
@@ -505,7 +548,6 @@ void vehicle_sounds_update();
|
||||
GForces vehicle_get_g_forces(const Vehicle* vehicle);
|
||||
void vehicle_set_map_toolbar(const Vehicle* vehicle);
|
||||
int32_t vehicle_is_used_in_pairs(const Vehicle* vehicle);
|
||||
int32_t vehicle_update_track_motion(Vehicle* vehicle, int32_t* outStation);
|
||||
rct_ride_entry_vehicle* vehicle_get_vehicle_entry(const Vehicle* vehicle);
|
||||
int32_t vehicle_get_total_num_peeps(const Vehicle* vehicle);
|
||||
void vehicle_invalidate_window(Vehicle* vehicle);
|
||||
|
||||
Reference in New Issue
Block a user