forked from rosebudai/OpenRCT2-Web
Refactor constant notation in Limits.h
This commit is contained in:
1 parent
d7f6baf307
commit
3c04e67ece
25 files changed
+220
-218
No files matched your search
@@ -2585,7 +2585,7 @@ static_assert(std::size(RatingNames) == 6);
|
||||
ride->SetReversedTrains(!ride->HasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS));
|
||||
break;
|
||||
case WIDX_VEHICLE_TRAINS_INCREASE:
|
||||
if (ride->NumTrains < OpenRCT2::Limits::MaxTrainsPerRide)
|
||||
if (ride->NumTrains < OpenRCT2::Limits::kMaxTrainsPerRide)
|
||||
ride->SetNumTrains(ride->NumTrains + 1);
|
||||
break;
|
||||
case WIDX_VEHICLE_TRAINS_DECREASE:
|
||||
@@ -6800,7 +6800,7 @@ static_assert(std::size(RatingNames) == 6);
|
||||
|
||||
// Get view index
|
||||
int16_t view = 1;
|
||||
for (int32_t i = 0; i <= OpenRCT2::Limits::MaxTrainsPerRide; i++)
|
||||
for (int32_t i = 0; i <= OpenRCT2::Limits::kMaxTrainsPerRide; i++)
|
||||
{
|
||||
if (ride->vehicles[i] == headVehicleSpriteIndex)
|
||||
break;
|
||||
|
||||
@@ -229,7 +229,7 @@ static void FixPeepsWithInvalidRideReference()
|
||||
// Fix possibly invalid field values
|
||||
for (auto peep : EntityList<Guest>())
|
||||
{
|
||||
if (peep->CurrentRideStation.ToUnderlying() >= OpenRCT2::Limits::MaxStationsPerRide)
|
||||
if (peep->CurrentRideStation.ToUnderlying() >= OpenRCT2::Limits::kMaxStationsPerRide)
|
||||
{
|
||||
const auto srcStation = peep->CurrentRideStation;
|
||||
const auto rideIdx = peep->CurrentRide;
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace OpenRCT2
|
||||
std::vector<Banner> Banners;
|
||||
Entity_t Entities[MAX_ENTITIES]{};
|
||||
// Ride storage for all the rides in the park, rides with RideId::Null are considered free.
|
||||
std::array<Ride, OpenRCT2::Limits::MaxRidesInPark> Rides{};
|
||||
std::array<Ride, OpenRCT2::Limits::kMaxRidesInPark> Rides{};
|
||||
::RideRatingUpdateStates RideRatingUpdateStates;
|
||||
std::vector<TileElement> TileElements;
|
||||
|
||||
|
||||
+11
-10
@@ -12,19 +12,20 @@
|
||||
|
||||
namespace OpenRCT2::Limits
|
||||
{
|
||||
constexpr uint16_t MaxRidesInPark = 1000;
|
||||
constexpr uint16_t MaxStationsPerRide = 255;
|
||||
constexpr uint8_t CustomerHistorySize = RCT12::Limits::CustomerHistorySize;
|
||||
constexpr uint16_t MaxGolfHoles = RCT12::Limits::MaxGolfHoles;
|
||||
constexpr uint16_t MaxHelices = RCT12::Limits::MaxHelices;
|
||||
constexpr uint16_t MaxInversions = RCT12::Limits::MaxInversions;
|
||||
constexpr uint16_t MaxTrainsPerRide = 255;
|
||||
constexpr uint16_t kMaxRidesInPark = 1000;
|
||||
constexpr uint16_t kMaxStationsPerRide = 255;
|
||||
constexpr uint8_t kCustomerHistorySize = RCT12::Limits::kCustomerHistorySize;
|
||||
constexpr uint16_t kMaxGolfHoles = RCT12::Limits::kMaxGolfHoles;
|
||||
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 const uint16_t MaxVehicleColours = MaxTrainsPerRide; // this should really be MaxTrainsPerRide * MaxCarsPerTrain
|
||||
// MaxVehicleColours should be set to MaxTrainsPerRide or MaxCarsPerTrain, whichever is higher.
|
||||
constexpr const uint16_t MaxVehicleColours = kMaxTrainsPerRide; // this should really be kMaxTrainsPerRide *
|
||||
// MaxCarsPerTrain
|
||||
// MaxVehicleColours should be set to kMaxTrainsPerRide or MaxCarsPerTrain, 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 >= MaxTrainsPerRide);
|
||||
static_assert(MaxVehicleColours >= kMaxTrainsPerRide);
|
||||
static_assert(MaxVehicleColours >= MaxCarsPerTrain);
|
||||
constexpr uint8_t MaxCircuitsPerRide = 20;
|
||||
constexpr uint8_t MaxAwards = RCT12::Limits::MaxAwards;
|
||||
|
||||
@@ -176,7 +176,7 @@ GameActions::Result RideCreateAction::Execute() const
|
||||
{
|
||||
ride->ProposedNumTrains = 32;
|
||||
}
|
||||
ride->max_trains = OpenRCT2::Limits::MaxTrainsPerRide;
|
||||
ride->max_trains = OpenRCT2::Limits::kMaxTrainsPerRide;
|
||||
ride->num_cars_per_train = 1;
|
||||
ride->proposed_num_cars_per_train = rideEntry->max_cars_in_train;
|
||||
ride->min_waiting_time = 10;
|
||||
|
||||
@@ -62,7 +62,7 @@ GameActions::Result RideEntranceExitPlaceAction::Query() const
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (_stationNum.ToUnderlying() >= Limits::MaxStationsPerRide)
|
||||
if (_stationNum.ToUnderlying() >= Limits::kMaxStationsPerRide)
|
||||
{
|
||||
LOG_ERROR("Invalid station number for ride. stationNum: %u", _stationNum.ToUnderlying());
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_ERR_VALUE_OUT_OF_RANGE);
|
||||
|
||||
@@ -1865,9 +1865,9 @@ Ride* Guest::FindBestRideToGoOn()
|
||||
return mostExcitingRide;
|
||||
}
|
||||
|
||||
OpenRCT2::BitSet<OpenRCT2::Limits::MaxRidesInPark> Guest::FindRidesToGoOn()
|
||||
OpenRCT2::BitSet<OpenRCT2::Limits::kMaxRidesInPark> Guest::FindRidesToGoOn()
|
||||
{
|
||||
OpenRCT2::BitSet<OpenRCT2::Limits::MaxRidesInPark> rideConsideration;
|
||||
OpenRCT2::BitSet<OpenRCT2::Limits::kMaxRidesInPark> rideConsideration;
|
||||
|
||||
// FIX Originally checked for a toy, likely a mistake and should be a map,
|
||||
// but then again this seems to only allow the peep to go on
|
||||
@@ -2562,7 +2562,7 @@ bool Guest::FindVehicleToEnter(const Ride& ride, std::vector<uint8_t>& car_array
|
||||
{
|
||||
chosen_train = ride.GetStation(CurrentRideStation).TrainAtStation;
|
||||
}
|
||||
if (chosen_train >= OpenRCT2::Limits::MaxTrainsPerRide)
|
||||
if (chosen_train >= OpenRCT2::Limits::kMaxTrainsPerRide)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -3145,7 +3145,7 @@ template<typename T> static void PeepHeadForNearestRide(Guest* peep, bool consid
|
||||
}
|
||||
}
|
||||
|
||||
OpenRCT2::BitSet<OpenRCT2::Limits::MaxRidesInPark> rideConsideration;
|
||||
OpenRCT2::BitSet<OpenRCT2::Limits::kMaxRidesInPark> rideConsideration;
|
||||
if (!considerOnlyCloseRides && (peep->HasItem(ShopItem::Map)))
|
||||
{
|
||||
// Consider all rides in the park
|
||||
@@ -3188,7 +3188,7 @@ template<typename T> static void PeepHeadForNearestRide(Guest* peep, bool consid
|
||||
}
|
||||
|
||||
// Filter the considered rides
|
||||
RideId potentialRides[OpenRCT2::Limits::MaxRidesInPark];
|
||||
RideId potentialRides[OpenRCT2::Limits::kMaxRidesInPark];
|
||||
size_t numPotentialRides = 0;
|
||||
for (auto& ride : GetRideManager())
|
||||
{
|
||||
@@ -3793,7 +3793,7 @@ static void PeepGoToRideExit(Peep* peep, const Ride& ride, int16_t x, int16_t y,
|
||||
|
||||
peep->MoveTo({ x, y, z });
|
||||
|
||||
Guard::Assert(peep->CurrentRideStation.ToUnderlying() < OpenRCT2::Limits::MaxStationsPerRide);
|
||||
Guard::Assert(peep->CurrentRideStation.ToUnderlying() < OpenRCT2::Limits::kMaxStationsPerRide);
|
||||
auto exit = ride.GetStation(peep->CurrentRideStation).Exit;
|
||||
x = exit.x;
|
||||
y = exit.y;
|
||||
@@ -4140,7 +4140,7 @@ void Guest::UpdateRideLeaveVehicle()
|
||||
vehicle->ApplyMass(-Mass);
|
||||
vehicle->Invalidate();
|
||||
|
||||
if (ride_station.ToUnderlying() >= OpenRCT2::Limits::MaxStationsPerRide)
|
||||
if (ride_station.ToUnderlying() >= OpenRCT2::Limits::kMaxStationsPerRide)
|
||||
{
|
||||
// HACK #5658: Some parks have hacked rides which end up in this state
|
||||
auto bestStationIndex = RideGetFirstValidStationExit(*ride);
|
||||
@@ -4159,7 +4159,7 @@ void Guest::UpdateRideLeaveVehicle()
|
||||
|
||||
const auto* carEntry = &rideEntry->Cars[vehicle->vehicle_type];
|
||||
|
||||
assert(CurrentRideStation.ToUnderlying() < OpenRCT2::Limits::MaxStationsPerRide);
|
||||
assert(CurrentRideStation.ToUnderlying() < OpenRCT2::Limits::kMaxStationsPerRide);
|
||||
auto& station = ride->GetStation(CurrentRideStation);
|
||||
|
||||
if (!(carEntry->flags & CAR_ENTRY_FLAG_LOADING_WAYPOINTS))
|
||||
|
||||
@@ -422,7 +422,7 @@ private:
|
||||
void MakePassingPeepsSick(Guest* passingPeep);
|
||||
void GivePassingPeepsIceCream(Guest* passingPeep);
|
||||
Ride* FindBestRideToGoOn();
|
||||
OpenRCT2::BitSet<OpenRCT2::Limits::MaxRidesInPark> FindRidesToGoOn();
|
||||
OpenRCT2::BitSet<OpenRCT2::Limits::kMaxRidesInPark> FindRidesToGoOn();
|
||||
bool FindVehicleToEnter(const Ride& ride, std::vector<uint8_t>& car_array);
|
||||
void GoToRideEntrance(const Ride& ride);
|
||||
};
|
||||
|
||||
@@ -1433,7 +1433,7 @@ static int32_t ConsoleCommandShowLimits(InteractiveConsole& console, [[maybe_unu
|
||||
console.WriteFormatLine("Sprites: %d/%d", spriteCount, MAX_ENTITIES);
|
||||
console.WriteFormatLine("Map Elements: %zu/%d", tileElementCount, MAX_TILE_ELEMENTS);
|
||||
console.WriteFormatLine("Banners: %d/%zu", bannerCount, MAX_BANNERS);
|
||||
console.WriteFormatLine("Rides: %d/%d", rideCount, OpenRCT2::Limits::MaxRidesInPark);
|
||||
console.WriteFormatLine("Rides: %d/%d", rideCount, OpenRCT2::Limits::kMaxRidesInPark);
|
||||
console.WriteFormatLine("Images: %zu/%zu", ImageListGetUsedCount(), ImageListGetMaximum());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1617,7 +1617,7 @@ namespace OpenRCT2
|
||||
static std::vector<RideId> LegacyGetRidesBeenOn(const std::array<uint8_t, 32>& srcArray)
|
||||
{
|
||||
std::vector<RideId> ridesBeenOn;
|
||||
for (uint16_t i = 0; i < RCT2::Limits::MaxRidesInPark; i++)
|
||||
for (uint16_t i = 0; i < RCT2::Limits::kMaxRidesInPark; i++)
|
||||
{
|
||||
if (srcArray[i / 8] & (1 << (i % 8)))
|
||||
{
|
||||
|
||||
@@ -1836,12 +1836,12 @@ namespace OpenRCT2::PathFinding
|
||||
* appropriate.
|
||||
*/
|
||||
static StationIndex GuestPathfindingSelectRandomStation(
|
||||
const Guest& guest, int32_t numEntranceStations, BitSet<OpenRCT2::Limits::MaxStationsPerRide>& entranceStations)
|
||||
const Guest& guest, int32_t numEntranceStations, BitSet<OpenRCT2::Limits::kMaxStationsPerRide>& entranceStations)
|
||||
{
|
||||
int32_t select = guest.GuestNumRides % numEntranceStations;
|
||||
while (select > 0)
|
||||
{
|
||||
for (StationIndex::UnderlyingType i = 0; i < OpenRCT2::Limits::MaxStationsPerRide; i++)
|
||||
for (StationIndex::UnderlyingType i = 0; i < OpenRCT2::Limits::kMaxStationsPerRide; i++)
|
||||
{
|
||||
if (entranceStations[i])
|
||||
{
|
||||
@@ -1851,7 +1851,7 @@ namespace OpenRCT2::PathFinding
|
||||
}
|
||||
}
|
||||
}
|
||||
for (StationIndex::UnderlyingType i = 0; i < OpenRCT2::Limits::MaxStationsPerRide; i++)
|
||||
for (StationIndex::UnderlyingType i = 0; i < OpenRCT2::Limits::kMaxStationsPerRide; i++)
|
||||
{
|
||||
if (entranceStations[i])
|
||||
{
|
||||
@@ -2042,7 +2042,7 @@ namespace OpenRCT2::PathFinding
|
||||
StationIndex closestStationNum = StationIndex::FromUnderlying(0);
|
||||
|
||||
int32_t numEntranceStations = 0;
|
||||
BitSet<OpenRCT2::Limits::MaxStationsPerRide> entranceStations = {};
|
||||
BitSet<OpenRCT2::Limits::kMaxStationsPerRide> entranceStations = {};
|
||||
|
||||
for (const auto& station : ride->GetStations())
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace RCT1::Limits
|
||||
using namespace RCT12::Limits;
|
||||
constexpr uint16_t MaxTileElements = 0xC000;
|
||||
constexpr uint16_t MaxEntities = 5000;
|
||||
constexpr uint8_t MaxTrainsPerRide = 12;
|
||||
constexpr uint8_t kMaxTrainsPerRide = 12;
|
||||
constexpr uint8_t MaxMapSize = 128;
|
||||
constexpr uint8_t MaxStaff = 116;
|
||||
constexpr uint16_t MaxAnimatedObjects = 1000;
|
||||
|
||||
+80
-80
@@ -246,55 +246,55 @@ namespace RCT1
|
||||
{
|
||||
colour_t Body;
|
||||
colour_t Trim;
|
||||
} VehicleColours[Limits::MaxTrainsPerRide]; // 0x006
|
||||
colour_t TrackPrimaryColour; // 0x01E
|
||||
colour_t TrackSecondaryColour; // 0x01F
|
||||
colour_t TrackSupportColour; // 0x020
|
||||
uint8_t Status; // 0x021
|
||||
uint16_t Name; // 0x022
|
||||
uint16_t NameArgumentRide; // 0x024
|
||||
uint16_t NameArgumentNumber; // 0x026
|
||||
RCT12xy8 OverallView; // 0x028
|
||||
RCT12xy8 StationStarts[Limits::MaxStationsPerRide]; // 0x02A
|
||||
uint8_t StationHeights[Limits::MaxStationsPerRide]; // 0x032
|
||||
uint8_t StationLengths[Limits::MaxStationsPerRide]; // 0x036
|
||||
uint8_t StationLights[Limits::MaxStationsPerRide]; // 0x03A
|
||||
uint8_t StationDeparts[Limits::MaxStationsPerRide]; // 0x03E
|
||||
RCT12xy8 Entrances[Limits::MaxStationsPerRide]; // 0x042
|
||||
RCT12xy8 Exits[Limits::MaxStationsPerRide]; // 0x04A
|
||||
uint16_t LastPeepInQueue[Limits::MaxStationsPerRide]; // 0x052
|
||||
uint8_t NumPeepsInQueue[Limits::MaxStationsPerRide]; // 0x05A
|
||||
uint16_t Vehicles[Limits::MaxTrainsPerRide]; // 0x05E
|
||||
uint8_t DepartFlags; // 0x076
|
||||
uint8_t NumStations; // 0x077
|
||||
uint8_t NumTrains; // 0x078
|
||||
uint8_t NumCarsPerTrain; // 0x079
|
||||
uint8_t ProposedNumTrains; // 0x07A
|
||||
uint8_t ProposedNumCarsPerTrain; // 0x07B
|
||||
uint8_t MaxTrains; // 0x07C
|
||||
uint8_t MinMaxCarsPerTrain; // 0x07D
|
||||
uint8_t MinWaitingTime; // 0x07E
|
||||
uint8_t MaxWaitingTime; // 0x07F
|
||||
uint8_t OperationOption; // 0x080
|
||||
uint8_t BoatHireReturnDirection; // 0x081
|
||||
RCT12xy8 BoatHireReturnPosition; // 0x082
|
||||
uint8_t DataLoggingIndex; // 0x084
|
||||
uint8_t SpecialTrackElements; // 0x085
|
||||
uint16_t Unk6; // 0x086
|
||||
int32_t MaxSpeed; // 0x088
|
||||
int32_t AverageSpeed; // 0x08C
|
||||
uint8_t CurrentTestSegment; // 0x090
|
||||
uint8_t AverageSpeedTestTimeout; // 0x091
|
||||
uint8_t Pad0E2[0x2]; // 0x092
|
||||
int32_t Length[Limits::MaxStationsPerRide]; // 0x094
|
||||
uint16_t Time[Limits::MaxStationsPerRide]; // 0x0A4
|
||||
fixed16_2dp MaxPositiveVerticalG; // 0x0AC
|
||||
fixed16_2dp MaxNegativeVerticalG; // 0x0AE
|
||||
fixed16_2dp MaxLateralG; // 0x0B0
|
||||
fixed16_2dp PreviousVerticalG; // 0x0B2
|
||||
fixed16_2dp PreviousLateralG; // 0x0B4
|
||||
uint8_t PadB6[0x2]; // 0x0B6
|
||||
uint32_t TestingFlags; // 0x0B8
|
||||
} VehicleColours[Limits::kMaxTrainsPerRide]; // 0x006
|
||||
colour_t TrackPrimaryColour; // 0x01E
|
||||
colour_t TrackSecondaryColour; // 0x01F
|
||||
colour_t TrackSupportColour; // 0x020
|
||||
uint8_t Status; // 0x021
|
||||
uint16_t Name; // 0x022
|
||||
uint16_t NameArgumentRide; // 0x024
|
||||
uint16_t NameArgumentNumber; // 0x026
|
||||
RCT12xy8 OverallView; // 0x028
|
||||
RCT12xy8 StationStarts[Limits::kMaxStationsPerRide]; // 0x02A
|
||||
uint8_t StationHeights[Limits::kMaxStationsPerRide]; // 0x032
|
||||
uint8_t StationLengths[Limits::kMaxStationsPerRide]; // 0x036
|
||||
uint8_t StationLights[Limits::kMaxStationsPerRide]; // 0x03A
|
||||
uint8_t StationDeparts[Limits::kMaxStationsPerRide]; // 0x03E
|
||||
RCT12xy8 Entrances[Limits::kMaxStationsPerRide]; // 0x042
|
||||
RCT12xy8 Exits[Limits::kMaxStationsPerRide]; // 0x04A
|
||||
uint16_t LastPeepInQueue[Limits::kMaxStationsPerRide]; // 0x052
|
||||
uint8_t NumPeepsInQueue[Limits::kMaxStationsPerRide]; // 0x05A
|
||||
uint16_t Vehicles[Limits::kMaxTrainsPerRide]; // 0x05E
|
||||
uint8_t DepartFlags; // 0x076
|
||||
uint8_t NumStations; // 0x077
|
||||
uint8_t NumTrains; // 0x078
|
||||
uint8_t NumCarsPerTrain; // 0x079
|
||||
uint8_t ProposedNumTrains; // 0x07A
|
||||
uint8_t ProposedNumCarsPerTrain; // 0x07B
|
||||
uint8_t MaxTrains; // 0x07C
|
||||
uint8_t MinMaxCarsPerTrain; // 0x07D
|
||||
uint8_t MinWaitingTime; // 0x07E
|
||||
uint8_t MaxWaitingTime; // 0x07F
|
||||
uint8_t OperationOption; // 0x080
|
||||
uint8_t BoatHireReturnDirection; // 0x081
|
||||
RCT12xy8 BoatHireReturnPosition; // 0x082
|
||||
uint8_t DataLoggingIndex; // 0x084
|
||||
uint8_t SpecialTrackElements; // 0x085
|
||||
uint16_t Unk6; // 0x086
|
||||
int32_t MaxSpeed; // 0x088
|
||||
int32_t AverageSpeed; // 0x08C
|
||||
uint8_t CurrentTestSegment; // 0x090
|
||||
uint8_t AverageSpeedTestTimeout; // 0x091
|
||||
uint8_t Pad0E2[0x2]; // 0x092
|
||||
int32_t Length[Limits::kMaxStationsPerRide]; // 0x094
|
||||
uint16_t Time[Limits::kMaxStationsPerRide]; // 0x0A4
|
||||
fixed16_2dp MaxPositiveVerticalG; // 0x0AC
|
||||
fixed16_2dp MaxNegativeVerticalG; // 0x0AE
|
||||
fixed16_2dp MaxLateralG; // 0x0B0
|
||||
fixed16_2dp PreviousVerticalG; // 0x0B2
|
||||
fixed16_2dp PreviousLateralG; // 0x0B4
|
||||
uint8_t PadB6[0x2]; // 0x0B6
|
||||
uint32_t TestingFlags; // 0x0B8
|
||||
// x y map location of the current track piece during a test
|
||||
// this is to prevent counting special tracks multiple times
|
||||
RCT12xy8 CurTestTrackLocation; // 0x0BC
|
||||
@@ -318,10 +318,10 @@ namespace RCT1
|
||||
int16_t UnkD0; // 0x0D0
|
||||
int16_t UnkD2; // 0x0D2
|
||||
// Customer count in the last 10 * 960 game ticks (sliding window)
|
||||
uint16_t NumCustomers[Limits::CustomerHistorySize]; // 0xD4
|
||||
money16 Price; // 0x0E8
|
||||
RCT12xy8 ChairliftBullwheelLocation[2]; // 0x0EA
|
||||
uint8_t ChairliftBullwheelZ[2]; // 0x0EE
|
||||
uint16_t NumCustomers[Limits::kCustomerHistorySize]; // 0xD4
|
||||
money16 Price; // 0x0E8
|
||||
RCT12xy8 ChairliftBullwheelLocation[2]; // 0x0EA
|
||||
uint8_t ChairliftBullwheelZ[2]; // 0x0EE
|
||||
union
|
||||
{
|
||||
RatingTuple Ratings;
|
||||
@@ -379,20 +379,20 @@ namespace RCT1
|
||||
};
|
||||
uint16_t Reliability; // 0x146
|
||||
};
|
||||
uint8_t UnreliabilityFactor; // 0x148
|
||||
uint8_t Downtime; // 0x149
|
||||
uint8_t InspectionInterval; // 0x14A
|
||||
uint8_t LastInspection; // 0x14B
|
||||
uint8_t Unk14C[20]; // 0x14C
|
||||
money32 IncomePerHour; // 0x160
|
||||
money32 Profit; // 0x164
|
||||
uint8_t QueueTime[Limits::MaxStationsPerRide]; // 0x168
|
||||
colour_t TrackColourMain[4]; // 0x16C
|
||||
colour_t TrackColourAdditional[4]; // 0x170
|
||||
colour_t TrackColourSupports[4]; // 0x174
|
||||
uint8_t Music; // 0x178
|
||||
uint8_t EntranceStyle; // 0x179
|
||||
uint8_t Unk17A[230]; // 0x17A
|
||||
uint8_t UnreliabilityFactor; // 0x148
|
||||
uint8_t Downtime; // 0x149
|
||||
uint8_t InspectionInterval; // 0x14A
|
||||
uint8_t LastInspection; // 0x14B
|
||||
uint8_t Unk14C[20]; // 0x14C
|
||||
money32 IncomePerHour; // 0x160
|
||||
money32 Profit; // 0x164
|
||||
uint8_t QueueTime[Limits::kMaxStationsPerRide]; // 0x168
|
||||
colour_t TrackColourMain[4]; // 0x16C
|
||||
colour_t TrackColourAdditional[4]; // 0x170
|
||||
colour_t TrackColourSupports[4]; // 0x174
|
||||
uint8_t Music; // 0x178
|
||||
uint8_t EntranceStyle; // 0x179
|
||||
uint8_t Unk17A[230]; // 0x17A
|
||||
};
|
||||
assert_struct_size(Ride, 0x260);
|
||||
|
||||
@@ -855,7 +855,7 @@ namespace RCT1
|
||||
RCT12Banner Banners[Limits::MaxBanners];
|
||||
char StringTable[Limits::MaxUserStrings][Limits::MaxUserStringLength];
|
||||
uint32_t GameTimeCounter;
|
||||
Ride Rides[Limits::MaxRidesInPark];
|
||||
Ride Rides[Limits::kMaxRidesInPark];
|
||||
uint16_t UnkGameTimeCounter;
|
||||
int16_t ViewX;
|
||||
int16_t ViewY;
|
||||
@@ -905,18 +905,18 @@ namespace RCT1
|
||||
{
|
||||
RideType Type; // 0x00
|
||||
RCT1::VehicleType VehicleType;
|
||||
uint32_t Flags; // 0x02
|
||||
uint8_t Mode; // 0x06
|
||||
uint8_t VersionAndColourScheme; // 0x07 0b0000_VVCC
|
||||
RCT12VehicleColour VehicleColours[Limits::MaxTrainsPerRide]; // 0x08
|
||||
uint8_t TrackSpineColourV0; // 0x20
|
||||
uint8_t TrackRailColourV0; // 0x21
|
||||
uint8_t TrackSupportColourV0; // 0x22
|
||||
uint8_t DepartFlags; // 0x23
|
||||
uint8_t NumberOfTrains; // 0x24
|
||||
uint8_t NumberOfCarsPerTrain; // 0x25
|
||||
uint8_t MinWaitingTime; // 0x26
|
||||
uint8_t MaxWaitingTime; // 0x27
|
||||
uint32_t Flags; // 0x02
|
||||
uint8_t Mode; // 0x06
|
||||
uint8_t VersionAndColourScheme; // 0x07 0b0000_VVCC
|
||||
RCT12VehicleColour VehicleColours[Limits::kMaxTrainsPerRide]; // 0x08
|
||||
uint8_t TrackSpineColourV0; // 0x20
|
||||
uint8_t TrackRailColourV0; // 0x21
|
||||
uint8_t TrackSupportColourV0; // 0x22
|
||||
uint8_t DepartFlags; // 0x23
|
||||
uint8_t NumberOfTrains; // 0x24
|
||||
uint8_t NumberOfCarsPerTrain; // 0x25
|
||||
uint8_t MinWaitingTime; // 0x26
|
||||
uint8_t MaxWaitingTime; // 0x27
|
||||
union
|
||||
{
|
||||
uint8_t OperationSetting;
|
||||
|
||||
@@ -798,7 +798,7 @@ namespace RCT1
|
||||
|
||||
void ImportRides()
|
||||
{
|
||||
for (int32_t i = 0; i < Limits::MaxRidesInPark; i++)
|
||||
for (int32_t i = 0; i < Limits::kMaxRidesInPark; i++)
|
||||
{
|
||||
if (_s4.Rides[i].Type != RideType::Null)
|
||||
{
|
||||
@@ -873,7 +873,7 @@ namespace RCT1
|
||||
dst->overall_view = TileCoordsXY{ src->OverallView.x, src->OverallView.y }.ToCoordsXY();
|
||||
}
|
||||
|
||||
for (StationIndex::UnderlyingType i = 0; i < Limits::MaxStationsPerRide; i++)
|
||||
for (StationIndex::UnderlyingType i = 0; i < Limits::kMaxStationsPerRide; i++)
|
||||
{
|
||||
auto& dstStation = dst->GetStation(StationIndex::FromUnderlying(i));
|
||||
if (src->StationStarts[i].IsNull())
|
||||
@@ -910,7 +910,7 @@ namespace RCT1
|
||||
dstStation.SegmentLength = src->Length[i];
|
||||
}
|
||||
// All other values take 0 as their default. Since they're already memset to that, no need to do it again.
|
||||
for (int32_t i = Limits::MaxStationsPerRide; i < OpenRCT2::Limits::MaxStationsPerRide; i++)
|
||||
for (int32_t i = Limits::kMaxStationsPerRide; i < OpenRCT2::Limits::kMaxStationsPerRide; i++)
|
||||
{
|
||||
auto& dstStation = dst->GetStation(StationIndex::FromUnderlying(i));
|
||||
dstStation.Start.SetNull();
|
||||
@@ -923,11 +923,11 @@ namespace RCT1
|
||||
dst->num_stations = src->NumStations;
|
||||
|
||||
// Vehicle links (indexes converted later)
|
||||
for (int32_t i = 0; i < Limits::MaxTrainsPerRide; i++)
|
||||
for (int32_t i = 0; i < Limits::kMaxTrainsPerRide; i++)
|
||||
{
|
||||
dst->vehicles[i] = EntityId::FromUnderlying(src->Vehicles[i]);
|
||||
}
|
||||
for (int32_t i = Limits::MaxTrainsPerRide; i <= OpenRCT2::Limits::MaxTrainsPerRide; i++)
|
||||
for (int32_t i = Limits::kMaxTrainsPerRide; i <= OpenRCT2::Limits::kMaxTrainsPerRide; i++)
|
||||
{
|
||||
dst->vehicles[i] = EntityId::GetNull();
|
||||
}
|
||||
@@ -1139,7 +1139,7 @@ namespace RCT1
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < Limits::MaxTrainsPerRide; i++)
|
||||
for (int i = 0; i < Limits::kMaxTrainsPerRide; i++)
|
||||
{
|
||||
// RCT1 had no third colour
|
||||
const auto colourSchemeCopyDescriptor = GetColourSchemeCopyDescriptor(src->VehicleType);
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace RCT1
|
||||
td->colour_scheme = td4Base.VersionAndColourScheme & 0x3;
|
||||
|
||||
// Vehicle colours
|
||||
for (int32_t i = 0; i < Limits::MaxTrainsPerRide; i++)
|
||||
for (int32_t i = 0; i < Limits::kMaxTrainsPerRide; i++)
|
||||
{
|
||||
// RCT1 had no third colour
|
||||
RCT1::VehicleColourSchemeCopyDescriptor colourSchemeCopyDescriptor = RCT1::GetColourSchemeCopyDescriptor(
|
||||
@@ -198,7 +198,7 @@ namespace RCT1
|
||||
}
|
||||
}
|
||||
// Set remaining vehicles to same colour as first vehicle
|
||||
for (size_t i = Limits::MaxTrainsPerRide; i < std::size(td->vehicle_colours); i++)
|
||||
for (size_t i = Limits::kMaxTrainsPerRide; i < std::size(td->vehicle_colours); i++)
|
||||
{
|
||||
td->vehicle_colours[i] = td->vehicle_colours[0];
|
||||
}
|
||||
|
||||
@@ -14,10 +14,10 @@ namespace RCT12::Limits
|
||||
{
|
||||
constexpr uint8_t MaxRideObjects = 128;
|
||||
|
||||
constexpr uint8_t MaxRidesInPark = 255;
|
||||
constexpr uint8_t kMaxRidesInPark = 255;
|
||||
constexpr uint8_t MaxAwards = 4;
|
||||
constexpr uint8_t MaxNewsItems = 61;
|
||||
constexpr uint8_t MaxStationsPerRide = 4;
|
||||
constexpr uint8_t kMaxStationsPerRide = 4;
|
||||
constexpr uint8_t MaxPeepSpawns = 2;
|
||||
constexpr uint8_t MaxParkEntrances = 4;
|
||||
// The number of elements in the patrol_areas array per staff member. Every bit in the array represents a 4x4 square.
|
||||
@@ -39,11 +39,11 @@ namespace RCT12::Limits
|
||||
|
||||
constexpr uint16_t RideMeasurementMaxItems = 4800;
|
||||
|
||||
constexpr uint16_t const MaxInversions = 31;
|
||||
constexpr uint16_t const MaxGolfHoles = 31;
|
||||
constexpr uint16_t const MaxHelices = 31;
|
||||
constexpr uint16_t const kMaxInversions = 31;
|
||||
constexpr uint16_t const kMaxGolfHoles = 31;
|
||||
constexpr uint16_t const kMaxHelices = 31;
|
||||
constexpr uint8_t MaxElementHeight = 255;
|
||||
constexpr uint8_t CustomerHistorySize = 10;
|
||||
constexpr uint8_t kCustomerHistorySize = 10;
|
||||
|
||||
constexpr uint8_t MaxWaitingTime = 250;
|
||||
} // namespace RCT12::Limits
|
||||
@@ -929,7 +929,7 @@ template<typename T> std::vector<uint16_t> RCT12GetRideTypesBeenOn(T* srcPeep)
|
||||
template<typename T> std::vector<RideId> RCT12GetRidesBeenOn(T* srcPeep)
|
||||
{
|
||||
std::vector<RideId> ridesBeenOn;
|
||||
for (uint16_t i = 0; i < RCT12::Limits::MaxRidesInPark; i++)
|
||||
for (uint16_t i = 0; i < RCT12::Limits::kMaxRidesInPark; i++)
|
||||
{
|
||||
if (srcPeep->RidesBeenOn[i / 8] & (1 << (i % 8)))
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace RCT2::Limits
|
||||
using namespace RCT12::Limits;
|
||||
constexpr uint8_t MaxStaff = 200;
|
||||
constexpr uint8_t MaxBanners = 250;
|
||||
constexpr uint8_t MaxTrainsPerRide = 32;
|
||||
constexpr uint8_t kMaxTrainsPerRide = 32;
|
||||
constexpr uint8_t MaxVehicleColours = 32;
|
||||
constexpr uint8_t DowntimeHistorySize = 8;
|
||||
constexpr uint16_t MaxEntities = 10000;
|
||||
|
||||
+51
-51
@@ -92,21 +92,21 @@ namespace RCT2
|
||||
uint16_t NameArgumentsNumber; // 0x04E
|
||||
};
|
||||
};
|
||||
RCT12xy8 OverallView; // 0x050
|
||||
RCT12xy8 StationStarts[Limits::MaxStationsPerRide]; // 0x052
|
||||
uint8_t StationHeights[Limits::MaxStationsPerRide]; // 0x05A
|
||||
uint8_t StationLength[Limits::MaxStationsPerRide]; // 0x05E
|
||||
uint8_t StationDepart[Limits::MaxStationsPerRide]; // 0x062
|
||||
RCT12xy8 OverallView; // 0x050
|
||||
RCT12xy8 StationStarts[Limits::kMaxStationsPerRide]; // 0x052
|
||||
uint8_t StationHeights[Limits::kMaxStationsPerRide]; // 0x05A
|
||||
uint8_t StationLength[Limits::kMaxStationsPerRide]; // 0x05E
|
||||
uint8_t StationDepart[Limits::kMaxStationsPerRide]; // 0x062
|
||||
// ride->vehicle index for current train waiting for passengers
|
||||
// at station
|
||||
uint8_t TrainAtStation[Limits::MaxStationsPerRide]; // 0x066
|
||||
RCT12xy8 Entrances[Limits::MaxStationsPerRide]; // 0x06A
|
||||
RCT12xy8 Exits[Limits::MaxStationsPerRide]; // 0x072
|
||||
uint16_t LastPeepInQueue[Limits::MaxStationsPerRide]; // 0x07A
|
||||
uint8_t Pad082[Limits::MaxStationsPerRide]; // 0x082, Used to be number of peeps in queue in RCT1, but this
|
||||
// has moved.
|
||||
uint16_t Vehicles[Limits::MaxTrainsPerRide]; // 0x086, Points to the first car in the train
|
||||
uint8_t DepartFlags; // 0x0C6
|
||||
uint8_t TrainAtStation[Limits::kMaxStationsPerRide]; // 0x066
|
||||
RCT12xy8 Entrances[Limits::kMaxStationsPerRide]; // 0x06A
|
||||
RCT12xy8 Exits[Limits::kMaxStationsPerRide]; // 0x072
|
||||
uint16_t LastPeepInQueue[Limits::kMaxStationsPerRide]; // 0x07A
|
||||
uint8_t Pad082[Limits::kMaxStationsPerRide]; // 0x082, Used to be number of peeps in queue in RCT1, but this
|
||||
// has moved.
|
||||
uint16_t Vehicles[Limits::kMaxTrainsPerRide]; // 0x086, Points to the first car in the train
|
||||
uint8_t DepartFlags; // 0x0C6
|
||||
|
||||
// Not sure if these should be uint or sint.
|
||||
uint8_t NumStations; // 0x0C7
|
||||
@@ -139,20 +139,20 @@ namespace RCT2
|
||||
uint8_t Pad0D6[2]; // 0x0D6
|
||||
// Divide this value by 29127 to get the human-readable max speed
|
||||
// (in RCT2, display_speed = (max_speed * 9) >> 18)
|
||||
int32_t MaxSpeed; // 0x0D8
|
||||
int32_t AverageSpeed; // 0x0DC
|
||||
uint8_t CurrentTestSegment; // 0x0E0
|
||||
uint8_t AverageSpeedTestTimeout; // 0x0E1
|
||||
uint8_t Pad0E2[0x2]; // 0x0E2
|
||||
int32_t Length[Limits::MaxStationsPerRide]; // 0x0E4
|
||||
uint16_t Time[Limits::MaxStationsPerRide]; // 0x0F4
|
||||
fixed16_2dp MaxPositiveVerticalG; // 0x0FC
|
||||
fixed16_2dp MaxNegativeVerticalG; // 0x0FE
|
||||
fixed16_2dp MaxLateralG; // 0x100
|
||||
fixed16_2dp PreviousVerticalG; // 0x102
|
||||
fixed16_2dp PreviousLateralG; // 0x104
|
||||
uint8_t Pad106[0x2]; // 0x106
|
||||
uint32_t TestingFlags; // 0x108
|
||||
int32_t MaxSpeed; // 0x0D8
|
||||
int32_t AverageSpeed; // 0x0DC
|
||||
uint8_t CurrentTestSegment; // 0x0E0
|
||||
uint8_t AverageSpeedTestTimeout; // 0x0E1
|
||||
uint8_t Pad0E2[0x2]; // 0x0E2
|
||||
int32_t Length[Limits::kMaxStationsPerRide]; // 0x0E4
|
||||
uint16_t Time[Limits::kMaxStationsPerRide]; // 0x0F4
|
||||
fixed16_2dp MaxPositiveVerticalG; // 0x0FC
|
||||
fixed16_2dp MaxNegativeVerticalG; // 0x0FE
|
||||
fixed16_2dp MaxLateralG; // 0x100
|
||||
fixed16_2dp PreviousVerticalG; // 0x102
|
||||
fixed16_2dp PreviousLateralG; // 0x104
|
||||
uint8_t Pad106[0x2]; // 0x106
|
||||
uint32_t TestingFlags; // 0x108
|
||||
// x y map location of the current track piece during a test
|
||||
// this is to prevent counting special tracks multiple times
|
||||
RCT12xy8 CurTestTrackLocation; // 0x10C
|
||||
@@ -183,10 +183,10 @@ namespace RCT2
|
||||
// Counts ticks to update customer intervals, resets each 960 game ticks.
|
||||
uint16_t NumCustomersTimeout; // 0x122
|
||||
// Customer count in the last 10 * 960 game ticks (sliding window)
|
||||
uint16_t NumCustomers[Limits::CustomerHistorySize]; // 0x124
|
||||
money16 Price; // 0x138
|
||||
RCT12xy8 ChairliftBullwheelLocation[2]; // 0x13A
|
||||
uint8_t ChairliftBullwheelZ[2]; // 0x13E
|
||||
uint16_t NumCustomers[Limits::kCustomerHistorySize]; // 0x124
|
||||
money16 Price; // 0x138
|
||||
RCT12xy8 ChairliftBullwheelLocation[2]; // 0x13A
|
||||
uint8_t ChairliftBullwheelZ[2]; // 0x13E
|
||||
union
|
||||
{
|
||||
RatingTuple Ratings; // 0x140
|
||||
@@ -263,7 +263,7 @@ namespace RCT2
|
||||
uint8_t ConnectedMessageThrottle; // 0x1AF
|
||||
money32 IncomePerHour; // 0x1B0
|
||||
money32 Profit; // 0x1B4
|
||||
uint8_t QueueTime[Limits::MaxStationsPerRide]; // 0x1B8
|
||||
uint8_t QueueTime[Limits::kMaxStationsPerRide]; // 0x1B8
|
||||
uint8_t TrackColourMain[Limits::NumColourSchemes]; // 0x1BC
|
||||
uint8_t TrackColourAdditional[Limits::NumColourSchemes]; // 0x1C0
|
||||
uint8_t TrackColourSupports[Limits::NumColourSchemes]; // 0x1C4
|
||||
@@ -283,7 +283,7 @@ namespace RCT2
|
||||
uint8_t CableLiftZ; // 0x1FC
|
||||
uint8_t Pad1FD; // 0x1FD
|
||||
uint16_t CableLift; // 0x1FE
|
||||
uint16_t QueueLength[Limits::MaxStationsPerRide]; // 0x200
|
||||
uint16_t QueueLength[Limits::kMaxStationsPerRide]; // 0x200
|
||||
uint8_t Pad208[0x58]; // 0x208
|
||||
|
||||
uint8_t GetMinCarsPerTrain() const;
|
||||
@@ -348,8 +348,8 @@ namespace RCT2
|
||||
uint8_t RideMode; // 0x06
|
||||
uint8_t TrackFlags; // 0x06
|
||||
};
|
||||
uint8_t VersionAndColourScheme; // 0x07 0b0000_VVCC
|
||||
RCT12VehicleColour VehicleColours[Limits::MaxTrainsPerRide]; // 0x08
|
||||
uint8_t VersionAndColourScheme; // 0x07 0b0000_VVCC
|
||||
RCT12VehicleColour VehicleColours[Limits::kMaxTrainsPerRide]; // 0x08
|
||||
union
|
||||
{
|
||||
uint8_t Pad48;
|
||||
@@ -382,21 +382,21 @@ namespace RCT2
|
||||
uint8_t Inversions; // 0x58
|
||||
uint8_t Holes; // 0x58
|
||||
};
|
||||
uint8_t Drops; // 0x59
|
||||
uint8_t HighestDropHeight; // 0x5A
|
||||
uint8_t Excitement; // 0x5B
|
||||
uint8_t Intensity; // 0x5C
|
||||
uint8_t Nausea; // 0x5D
|
||||
money16 UpkeepCost; // 0x5E
|
||||
uint8_t TrackSpineColour[Limits::NumColourSchemes]; // 0x60
|
||||
uint8_t TrackRailColour[Limits::NumColourSchemes]; // 0x64
|
||||
uint8_t TrackSupportColour[Limits::NumColourSchemes]; // 0x68
|
||||
uint32_t Flags2; // 0x6C
|
||||
RCTObjectEntry VehicleObject; // 0x70
|
||||
uint8_t SpaceRequiredX; // 0x80
|
||||
uint8_t SpaceRequiredY; // 0x81
|
||||
uint8_t VehicleAdditionalColour[Limits::MaxTrainsPerRide]; // 0x82
|
||||
uint8_t LiftHillSpeedNumCircuits; // 0xA2 0bCCCL_LLLL
|
||||
uint8_t Drops; // 0x59
|
||||
uint8_t HighestDropHeight; // 0x5A
|
||||
uint8_t Excitement; // 0x5B
|
||||
uint8_t Intensity; // 0x5C
|
||||
uint8_t Nausea; // 0x5D
|
||||
money16 UpkeepCost; // 0x5E
|
||||
uint8_t TrackSpineColour[Limits::NumColourSchemes]; // 0x60
|
||||
uint8_t TrackRailColour[Limits::NumColourSchemes]; // 0x64
|
||||
uint8_t TrackSupportColour[Limits::NumColourSchemes]; // 0x68
|
||||
uint32_t Flags2; // 0x6C
|
||||
RCTObjectEntry VehicleObject; // 0x70
|
||||
uint8_t SpaceRequiredX; // 0x80
|
||||
uint8_t SpaceRequiredY; // 0x81
|
||||
uint8_t VehicleAdditionalColour[Limits::kMaxTrainsPerRide]; // 0x82
|
||||
uint8_t LiftHillSpeedNumCircuits; // 0xA2 0bCCCL_LLLL
|
||||
// 0xA3 (data starts here in file)
|
||||
};
|
||||
assert_struct_size(TD6Track, 0xA3);
|
||||
@@ -989,7 +989,7 @@ namespace RCT2
|
||||
RCT12Banner Banners[Limits::MaxBanners];
|
||||
char CustomStrings[Limits::MaxUserStrings][Limits::MaxUserStringLength];
|
||||
uint32_t GameTicks1;
|
||||
Ride Rides[Limits::MaxRidesInPark];
|
||||
Ride Rides[Limits::kMaxRidesInPark];
|
||||
uint16_t SavedAge; // unused
|
||||
int16_t SavedViewX;
|
||||
int16_t SavedViewY;
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace RCT2
|
||||
uint8_t _gameVersion = 0;
|
||||
bool _isSV7 = false;
|
||||
bool _isScenario = false;
|
||||
OpenRCT2::BitSet<Limits::MaxRidesInPark> _isFlatRide{};
|
||||
OpenRCT2::BitSet<Limits::kMaxRidesInPark> _isFlatRide{};
|
||||
ObjectEntryIndex _pathToSurfaceMap[16];
|
||||
ObjectEntryIndex _pathToQueueSurfaceMap[16];
|
||||
ObjectEntryIndex _pathToRailingMap[16];
|
||||
@@ -1231,7 +1231,7 @@ namespace RCT2
|
||||
|
||||
void ImportRides()
|
||||
{
|
||||
for (uint8_t index = 0; index < Limits::MaxRidesInPark; index++)
|
||||
for (uint8_t index = 0; index < Limits::kMaxRidesInPark; index++)
|
||||
{
|
||||
auto src = &_s6.Rides[index];
|
||||
if (src->Type != RIDE_TYPE_NULL)
|
||||
@@ -1257,7 +1257,7 @@ namespace RCT2
|
||||
*/
|
||||
void DetermineFlatRideStatus()
|
||||
{
|
||||
for (uint8_t index = 0; index < Limits::MaxRidesInPark; index++)
|
||||
for (uint8_t index = 0; index < Limits::kMaxRidesInPark; index++)
|
||||
{
|
||||
auto src = &_s6.Rides[index];
|
||||
if (src->Type == RIDE_TYPE_NULL)
|
||||
@@ -1347,7 +1347,7 @@ namespace RCT2
|
||||
dst->overall_view = tileLoc.ToCoordsXY();
|
||||
}
|
||||
|
||||
for (StationIndex::UnderlyingType i = 0; i < Limits::MaxStationsPerRide; i++)
|
||||
for (StationIndex::UnderlyingType i = 0; i < Limits::kMaxStationsPerRide; i++)
|
||||
{
|
||||
StationIndex stationIndex = StationIndex::FromUnderlying(i);
|
||||
auto& destStation = dst->GetStation(stationIndex);
|
||||
@@ -1387,7 +1387,7 @@ namespace RCT2
|
||||
destStation.QueueLength = src->QueueLength[i];
|
||||
}
|
||||
// All other values take 0 as their default. Since they're already memset to that, no need to do it again.
|
||||
for (int32_t i = Limits::MaxStationsPerRide; i < OpenRCT2::Limits::MaxStationsPerRide; i++)
|
||||
for (int32_t i = Limits::kMaxStationsPerRide; i < OpenRCT2::Limits::kMaxStationsPerRide; i++)
|
||||
{
|
||||
StationIndex stationIndex = StationIndex::FromUnderlying(i);
|
||||
auto& destStation = dst->GetStation(stationIndex);
|
||||
@@ -1399,11 +1399,11 @@ namespace RCT2
|
||||
destStation.LastPeepInQueue = EntityId::GetNull();
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < Limits::MaxTrainsPerRide; i++)
|
||||
for (int32_t i = 0; i < Limits::kMaxTrainsPerRide; i++)
|
||||
{
|
||||
dst->vehicles[i] = EntityId::FromUnderlying(src->Vehicles[i]);
|
||||
}
|
||||
for (int32_t i = Limits::MaxTrainsPerRide - 1; i <= OpenRCT2::Limits::MaxTrainsPerRide; i++)
|
||||
for (int32_t i = Limits::kMaxTrainsPerRide - 1; i <= OpenRCT2::Limits::kMaxTrainsPerRide; i++)
|
||||
{
|
||||
dst->vehicles[i] = EntityId::GetNull();
|
||||
}
|
||||
@@ -1471,7 +1471,7 @@ namespace RCT2
|
||||
dst->cur_num_customers = src->CurNumCustomers;
|
||||
dst->num_customers_timeout = src->NumCustomersTimeout;
|
||||
|
||||
for (uint8_t i = 0; i < Limits::CustomerHistorySize; i++)
|
||||
for (uint8_t i = 0; i < Limits::kCustomerHistorySize; i++)
|
||||
{
|
||||
dst->num_customers[i] = src->NumCustomers[i];
|
||||
}
|
||||
@@ -1588,7 +1588,7 @@ namespace RCT2
|
||||
dst->guests_favourite = src->GuestsFavourite;
|
||||
dst->lifecycle_flags = src->LifecycleFlags;
|
||||
|
||||
for (uint8_t i = 0; i < Limits::MaxTrainsPerRide; i++)
|
||||
for (uint8_t i = 0; i < Limits::kMaxTrainsPerRide; i++)
|
||||
{
|
||||
dst->vehicle_colours[i].Tertiary = src->VehicleColoursExtended[i];
|
||||
}
|
||||
@@ -1615,7 +1615,7 @@ namespace RCT2
|
||||
dst.ProximityStart = { src.ProximityStartX, src.ProximityStartY, src.ProximityStartZ };
|
||||
dst.CurrentRide = RCT12RideIdToOpenRCT2RideId(src.CurrentRide);
|
||||
dst.State = src.State;
|
||||
if (src.CurrentRide < Limits::MaxRidesInPark && _s6.Rides[src.CurrentRide].Type < std::size(RideTypeDescriptors))
|
||||
if (src.CurrentRide < Limits::kMaxRidesInPark && _s6.Rides[src.CurrentRide].Type < std::size(RideTypeDescriptors))
|
||||
dst.ProximityTrackType = RCT2TrackTypeToOpenRCT2(
|
||||
src.ProximityTrackType, _s6.Rides[src.CurrentRide].Type, IsFlatRide(src.CurrentRide));
|
||||
else
|
||||
|
||||
+15
-15
@@ -364,7 +364,7 @@ void Ride::UpdateQueueLength(StationIndex stationIndex)
|
||||
|
||||
void Ride::QueueInsertGuestAtFront(StationIndex stationIndex, Guest* peep)
|
||||
{
|
||||
assert(stationIndex.ToUnderlying() < OpenRCT2::Limits::MaxStationsPerRide);
|
||||
assert(stationIndex.ToUnderlying() < OpenRCT2::Limits::kMaxStationsPerRide);
|
||||
assert(peep != nullptr);
|
||||
|
||||
peep->GuestNextInQueue = EntityId::GetNull();
|
||||
@@ -1065,12 +1065,12 @@ const RideStation& Ride::GetStation(StationIndex stationIndex) const
|
||||
return stations[stationIndex.ToUnderlying()];
|
||||
}
|
||||
|
||||
std::array<RideStation, OpenRCT2::Limits::MaxStationsPerRide>& Ride::GetStations()
|
||||
std::array<RideStation, OpenRCT2::Limits::kMaxStationsPerRide>& Ride::GetStations()
|
||||
{
|
||||
return stations;
|
||||
}
|
||||
|
||||
const std::array<RideStation, OpenRCT2::Limits::MaxStationsPerRide>& Ride::GetStations() const
|
||||
const std::array<RideStation, OpenRCT2::Limits::kMaxStationsPerRide>& Ride::GetStations() const
|
||||
{
|
||||
return stations;
|
||||
}
|
||||
@@ -1096,7 +1096,7 @@ void Ride::Update()
|
||||
// Update stations
|
||||
const auto& rtd = GetRideTypeDescriptor();
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE))
|
||||
for (StationIndex::UnderlyingType i = 0; i < OpenRCT2::Limits::MaxStationsPerRide; i++)
|
||||
for (StationIndex::UnderlyingType i = 0; i < OpenRCT2::Limits::kMaxStationsPerRide; i++)
|
||||
RideUpdateStation(*this, StationIndex::FromUnderlying(i));
|
||||
|
||||
// Update financial statistics
|
||||
@@ -1108,7 +1108,7 @@ void Ride::Update()
|
||||
num_customers_timeout = 0;
|
||||
|
||||
// Shift number of customers history, start of the array is the most recent one
|
||||
for (int32_t i = OpenRCT2::Limits::CustomerHistorySize - 1; i > 0; i--)
|
||||
for (int32_t i = OpenRCT2::Limits::kCustomerHistorySize - 1; i > 0; i--)
|
||||
{
|
||||
num_customers[i] = num_customers[i - 1];
|
||||
}
|
||||
@@ -1281,7 +1281,7 @@ void UpdateSpiralSlide(Ride& ride)
|
||||
|
||||
const uint8_t current_rotation = GetCurrentRotation();
|
||||
// Invalidate something related to station start
|
||||
for (int32_t i = 0; i < OpenRCT2::Limits::MaxStationsPerRide; i++)
|
||||
for (int32_t i = 0; i < OpenRCT2::Limits::kMaxStationsPerRide; i++)
|
||||
{
|
||||
if (ride.stations[i].Start.IsNull())
|
||||
continue;
|
||||
@@ -3017,7 +3017,7 @@ static void RideSetBoatHireReturnPoint(Ride& ride, const CoordsXYE& startElement
|
||||
static void RideSetMazeEntranceExitPoints(Ride& ride)
|
||||
{
|
||||
// Needs room for an entrance and an exit per station, plus one position for the list terminator.
|
||||
TileCoordsXYZD positions[(OpenRCT2::Limits::MaxStationsPerRide * 2) + 1];
|
||||
TileCoordsXYZD positions[(OpenRCT2::Limits::kMaxStationsPerRide * 2) + 1];
|
||||
|
||||
// Create a list of all the entrance and exit positions
|
||||
TileCoordsXYZD* position = positions;
|
||||
@@ -3494,7 +3494,7 @@ static bool VehicleCreateTrains(Ride& ride, const CoordsXYZ& trainsPos, TrackEle
|
||||
}
|
||||
lastTrain = train;
|
||||
|
||||
for (int32_t i = 0; i <= OpenRCT2::Limits::MaxTrainsPerRide; i++)
|
||||
for (int32_t i = 0; i <= OpenRCT2::Limits::kMaxTrainsPerRide; i++)
|
||||
{
|
||||
if (ride.vehicles[i].IsNull())
|
||||
{
|
||||
@@ -3634,7 +3634,7 @@ ResultWithMessage Ride::CreateVehicles(const CoordsXYE& element, bool isApplying
|
||||
// Initialise station departs
|
||||
// 006DDDD0:
|
||||
lifecycle_flags |= RIDE_LIFECYCLE_ON_TRACK;
|
||||
for (int32_t i = 0; i < OpenRCT2::Limits::MaxStationsPerRide; i++)
|
||||
for (int32_t i = 0; i < OpenRCT2::Limits::kMaxStationsPerRide; i++)
|
||||
{
|
||||
stations[i].Depart = (stations[i].Depart & kStationDepartFlag) | 1;
|
||||
}
|
||||
@@ -4698,7 +4698,7 @@ void RideUpdateVehicleColours(const Ride& ride)
|
||||
GfxInvalidateScreen();
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i <= OpenRCT2::Limits::MaxTrainsPerRide; i++)
|
||||
for (int32_t i = 0; i <= OpenRCT2::Limits::kMaxTrainsPerRide; i++)
|
||||
{
|
||||
int32_t carIndex = 0;
|
||||
VehicleColour colours = {};
|
||||
@@ -5093,7 +5093,7 @@ void Ride::UpdateMaxVehicles()
|
||||
{
|
||||
case RideMode::ContinuousCircuitBlockSectioned:
|
||||
case RideMode::PoweredLaunchBlockSectioned:
|
||||
maxNumTrains = std::clamp<int32_t>(num_stations + num_block_brakes - 1, 1, OpenRCT2::Limits::MaxTrainsPerRide);
|
||||
maxNumTrains = std::clamp<int32_t>(num_stations + num_block_brakes - 1, 1, OpenRCT2::Limits::kMaxTrainsPerRide);
|
||||
break;
|
||||
case RideMode::ReverseInclineLaunchedShuttle:
|
||||
case RideMode::PoweredLaunchPasstrough:
|
||||
@@ -5125,7 +5125,7 @@ void Ride::UpdateMaxVehicles()
|
||||
if ((mode != RideMode::StationToStation && mode != RideMode::ContinuousCircuit)
|
||||
|| !(rtd.HasFlag(RIDE_TYPE_FLAG_ALLOW_MORE_VEHICLES_THAN_STATION_FITS)))
|
||||
{
|
||||
maxNumTrains = std::min(maxNumTrains, int32_t(OpenRCT2::Limits::MaxTrainsPerRide));
|
||||
maxNumTrains = std::min(maxNumTrains, int32_t(OpenRCT2::Limits::kMaxTrainsPerRide));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5154,7 +5154,7 @@ void Ride::UpdateMaxVehicles()
|
||||
{
|
||||
maxNumTrains++;
|
||||
length += totalSpacing;
|
||||
} while (maxNumTrains < OpenRCT2::Limits::MaxTrainsPerRide && length < trackLength);
|
||||
} while (maxNumTrains < OpenRCT2::Limits::kMaxTrainsPerRide && length < trackLength);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -5173,7 +5173,7 @@ void Ride::UpdateMaxVehicles()
|
||||
|
||||
if (GetGameState().Cheats.DisableTrainLengthLimit)
|
||||
{
|
||||
maxNumTrains = OpenRCT2::Limits::MaxTrainsPerRide;
|
||||
maxNumTrains = OpenRCT2::Limits::kMaxTrainsPerRide;
|
||||
}
|
||||
numTrains = std::min(ProposedNumTrains, static_cast<uint8_t>(maxNumTrains));
|
||||
|
||||
@@ -5272,7 +5272,7 @@ uint32_t RideCustomersInLast5Minutes(const Ride& ride)
|
||||
{
|
||||
uint32_t sum = 0;
|
||||
|
||||
for (int32_t i = 0; i < OpenRCT2::Limits::CustomerHistorySize; i++)
|
||||
for (int32_t i = 0; i < OpenRCT2::Limits::kCustomerHistorySize; i++)
|
||||
{
|
||||
sum += ride.num_customers[i];
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ constexpr uint8_t kRideAdjacencyCheckDistance = 5;
|
||||
|
||||
constexpr uint8_t TUNE_ID_NULL = 0xFF;
|
||||
|
||||
constexpr uint16_t const MAX_STATION_LOCATIONS = OpenRCT2::Limits::MaxStationsPerRide * 2; // Entrance and exit per station
|
||||
constexpr uint16_t const MAX_STATION_LOCATIONS = OpenRCT2::Limits::kMaxStationsPerRide * 2; // Entrance and exit per station
|
||||
|
||||
constexpr uint16_t const MAZE_CLEARANCE_HEIGHT = 4 * COORDS_Z_STEP;
|
||||
|
||||
@@ -127,7 +127,7 @@ struct Ride
|
||||
std::string custom_name;
|
||||
uint16_t default_name_number{};
|
||||
CoordsXY overall_view;
|
||||
EntityId vehicles[OpenRCT2::Limits::MaxTrainsPerRide + 1]{}; // Points to the first car in the train
|
||||
EntityId vehicles[OpenRCT2::Limits::kMaxTrainsPerRide + 1]{}; // Points to the first car in the train
|
||||
uint8_t depart_flags{};
|
||||
uint8_t num_stations{};
|
||||
uint8_t NumTrains{};
|
||||
@@ -188,7 +188,7 @@ struct Ride
|
||||
// Counts ticks to update customer intervals, resets each 960 game ticks.
|
||||
uint16_t num_customers_timeout{};
|
||||
// Customer count in the last 10 * 960 game ticks (sliding window)
|
||||
uint16_t num_customers[OpenRCT2::Limits::CustomerHistorySize]{};
|
||||
uint16_t num_customers[OpenRCT2::Limits::kCustomerHistorySize]{};
|
||||
money64 price[RCT2::ObjectLimits::MaxShopItemsPerRideEntry]{};
|
||||
TileCoordsXYZ ChairliftBullwheelLocation[2];
|
||||
union
|
||||
@@ -286,13 +286,13 @@ struct Ride
|
||||
friend void UpdateChairlift(Ride& ride);
|
||||
|
||||
private:
|
||||
std::array<RideStation, OpenRCT2::Limits::MaxStationsPerRide> stations{};
|
||||
std::array<RideStation, OpenRCT2::Limits::kMaxStationsPerRide> stations{};
|
||||
|
||||
public:
|
||||
RideStation& GetStation(StationIndex stationIndex = StationIndex::FromUnderlying(0));
|
||||
const RideStation& GetStation(StationIndex stationIndex = StationIndex::FromUnderlying(0)) const;
|
||||
std::array<RideStation, OpenRCT2::Limits::MaxStationsPerRide>& GetStations();
|
||||
const std::array<RideStation, OpenRCT2::Limits::MaxStationsPerRide>& GetStations() const;
|
||||
std::array<RideStation, OpenRCT2::Limits::kMaxStationsPerRide>& GetStations();
|
||||
const std::array<RideStation, OpenRCT2::Limits::kMaxStationsPerRide>& GetStations() const;
|
||||
StationIndex GetStationIndex(const RideStation* station) const;
|
||||
|
||||
// Returns the logical station number from the given station. Index 0 = station 1, index 1 = station 2. It accounts for gaps
|
||||
|
||||
@@ -180,7 +180,7 @@ void Ride::RemoveVehicles()
|
||||
lifecycle_flags &= ~RIDE_LIFECYCLE_ON_TRACK;
|
||||
lifecycle_flags &= ~(RIDE_LIFECYCLE_TEST_IN_PROGRESS | RIDE_LIFECYCLE_HAS_STALLED_VEHICLE);
|
||||
|
||||
for (size_t i = 0; i <= OpenRCT2::Limits::MaxTrainsPerRide; i++)
|
||||
for (size_t i = 0; i <= OpenRCT2::Limits::kMaxTrainsPerRide; i++)
|
||||
{
|
||||
auto spriteIndex = vehicles[i];
|
||||
while (!spriteIndex.IsNull())
|
||||
@@ -198,7 +198,7 @@ void Ride::RemoveVehicles()
|
||||
vehicles[i] = EntityId::GetNull();
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < OpenRCT2::Limits::MaxStationsPerRide; i++)
|
||||
for (size_t i = 0; i < OpenRCT2::Limits::kMaxStationsPerRide; i++)
|
||||
stations[i].TrainAtStation = RideStation::kNoTrain;
|
||||
|
||||
// Also clean up orphaned vehicles for good measure.
|
||||
|
||||
@@ -123,7 +123,7 @@ ResultWithMessage TrackAddStationElement(CoordsXYZD loc, RideId rideIndex, int32
|
||||
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
{
|
||||
if (ride->num_stations >= Limits::MaxStationsPerRide)
|
||||
if (ride->num_stations >= Limits::kMaxStationsPerRide)
|
||||
{
|
||||
return { false, STR_NO_MORE_STATIONS_ALLOWED_ON_THIS_RIDE };
|
||||
}
|
||||
@@ -192,7 +192,7 @@ ResultWithMessage TrackAddStationElement(CoordsXYZD loc, RideId rideIndex, int32
|
||||
// When attempting to place a track design, it sometimes happens that the front and back of station 0 are built,
|
||||
// but the middle is not. Allow this, so the track place function can actually finish building all 4 stations.
|
||||
// This _might_ cause issues if the track designs is bugged and actually has 5.
|
||||
if (stationBackLoc == stationFrontLoc && ride->num_stations >= Limits::MaxStationsPerRide && !fromTrackDesign)
|
||||
if (stationBackLoc == stationFrontLoc && ride->num_stations >= Limits::kMaxStationsPerRide && !fromTrackDesign)
|
||||
{
|
||||
return { false, STR_NO_MORE_STATIONS_ALLOWED_ON_THIS_RIDE };
|
||||
}
|
||||
@@ -329,7 +329,8 @@ ResultWithMessage TrackRemoveStationElement(const CoordsXYZD& loc, RideId rideIn
|
||||
|
||||
if (!(flags & GAME_COMMAND_FLAG_APPLY))
|
||||
{
|
||||
if ((removeLoc != stationBackLoc) && (removeLoc != stationFrontLoc) && ride->num_stations >= Limits::MaxStationsPerRide)
|
||||
if ((removeLoc != stationBackLoc) && (removeLoc != stationFrontLoc)
|
||||
&& ride->num_stations >= Limits::kMaxStationsPerRide)
|
||||
{
|
||||
return { false, STR_NO_MORE_STATIONS_ALLOWED_ON_THIS_RIDE };
|
||||
}
|
||||
|
||||
@@ -782,7 +782,7 @@ void RideUpdateMeasurementsSpecialElements_Default(Ride& ride, const track_type_
|
||||
uint16_t trackFlags = ted.Flags;
|
||||
if (trackFlags & TRACK_ELEM_FLAG_NORMAL_TO_INVERSION)
|
||||
{
|
||||
if (ride.inversions < OpenRCT2::Limits::MaxInversions)
|
||||
if (ride.inversions < OpenRCT2::Limits::kMaxInversions)
|
||||
ride.inversions++;
|
||||
}
|
||||
}
|
||||
@@ -793,7 +793,7 @@ void RideUpdateMeasurementsSpecialElements_MiniGolf(Ride& ride, const track_type
|
||||
uint16_t trackFlags = ted.Flags;
|
||||
if (trackFlags & TRACK_ELEM_FLAG_IS_GOLF_HOLE)
|
||||
{
|
||||
if (ride.holes < OpenRCT2::Limits::MaxGolfHoles)
|
||||
if (ride.holes < OpenRCT2::Limits::kMaxGolfHoles)
|
||||
ride.holes++;
|
||||
}
|
||||
}
|
||||
@@ -1075,7 +1075,7 @@ void Vehicle::UpdateMeasurements()
|
||||
if (trackFlags & TRACK_ELEM_FLAG_HELIX)
|
||||
{
|
||||
uint8_t helixes = RideGetHelixSections(*curRide);
|
||||
if (helixes != OpenRCT2::Limits::MaxHelices)
|
||||
if (helixes != OpenRCT2::Limits::kMaxHelices)
|
||||
helixes++;
|
||||
|
||||
curRide->special_track_elements &= ~0x1F;
|
||||
|
||||
Reference in new issue
Block a user