mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-19 21:13:05 +01:00
Rename MaxCarsPerTrain to kMaxTrainsPerRide
This commit is contained in:
@@ -2593,7 +2593,7 @@ static_assert(std::size(RatingNames) == 6);
|
||||
ride->SetNumTrains(ride->NumTrains - 1);
|
||||
break;
|
||||
case WIDX_VEHICLE_CARS_PER_TRAIN_INCREASE:
|
||||
if (ride->num_cars_per_train < OpenRCT2::Limits::MaxCarsPerTrain)
|
||||
if (ride->num_cars_per_train < OpenRCT2::Limits::kMaxCarsPerTrain)
|
||||
ride->SetNumCarsPerVehicle(ride->num_cars_per_train + 1);
|
||||
break;
|
||||
case WIDX_VEHICLE_CARS_PER_TRAIN_DECREASE:
|
||||
@@ -2897,7 +2897,7 @@ static_assert(std::size(RatingNames) == 6);
|
||||
// For each train
|
||||
for (int32_t i = 0; i < ride->NumTrains; i++)
|
||||
{
|
||||
VehicleDrawInfo trainCarImages[OpenRCT2::Limits::MaxCarsPerTrain];
|
||||
VehicleDrawInfo trainCarImages[OpenRCT2::Limits::kMaxCarsPerTrain];
|
||||
VehicleDrawInfo* nextSpriteToDraw = trainCarImages;
|
||||
int32_t x = startX;
|
||||
int32_t y = startY;
|
||||
|
||||
@@ -19,14 +19,14 @@ namespace OpenRCT2::Limits
|
||||
constexpr uint16_t kMaxHelices = RCT12::Limits::kMaxHelices;
|
||||
constexpr uint16_t kMaxInversions = RCT12::Limits::kMaxInversions;
|
||||
constexpr uint16_t kMaxTrainsPerRide = 255;
|
||||
constexpr uint16_t MaxCarsPerTrain = 255;
|
||||
constexpr uint16_t kMaxCarsPerTrain = 255;
|
||||
constexpr const uint16_t MaxVehicleColours = kMaxTrainsPerRide; // this should really be kMaxTrainsPerRide *
|
||||
// MaxCarsPerTrain
|
||||
// MaxVehicleColours should be set to kMaxTrainsPerRide or MaxCarsPerTrain, whichever is higher.
|
||||
// kMaxCarsPerTrain
|
||||
// MaxVehicleColours should be set to kMaxTrainsPerRide or kMaxCarsPerTrain, whichever is higher.
|
||||
// Sadly, using std::max() will cause compilation failures when using MaxVehicleColours as an array size,
|
||||
// hence the usage of static asserts.
|
||||
static_assert(MaxVehicleColours >= kMaxTrainsPerRide);
|
||||
static_assert(MaxVehicleColours >= MaxCarsPerTrain);
|
||||
static_assert(MaxVehicleColours >= kMaxCarsPerTrain);
|
||||
constexpr uint8_t MaxCircuitsPerRide = 20;
|
||||
constexpr uint8_t MaxAwards = RCT12::Limits::MaxAwards;
|
||||
constexpr uint8_t NumColourSchemes = RCT12::Limits::NumColourSchemes;
|
||||
|
||||
@@ -4718,11 +4718,11 @@ void RideUpdateVehicleColours(const Ride& ride)
|
||||
if (vehicle->HasFlag(VehicleFlags::CarIsReversed))
|
||||
{
|
||||
colours = ride.vehicle_colours[std::min(
|
||||
(ride.num_cars_per_train - 1) - carIndex, OpenRCT2::Limits::MaxCarsPerTrain - 1)];
|
||||
(ride.num_cars_per_train - 1) - carIndex, OpenRCT2::Limits::kMaxCarsPerTrain - 1)];
|
||||
}
|
||||
else
|
||||
{
|
||||
colours = ride.vehicle_colours[std::min(carIndex, OpenRCT2::Limits::MaxCarsPerTrain - 1)];
|
||||
colours = ride.vehicle_colours[std::min(carIndex, OpenRCT2::Limits::kMaxCarsPerTrain - 1)];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user