1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 21:43:06 +01:00

Introduce Limits headers. (#15329)

* Move RCT12 limits to seperate file and namespace

* Remove prefix from constants

* Add rct1 limits file

* Rename constants to remove prefix

* Add RCT2 limits file

* Remove RCT2 prefix from constants

* Move constant to correct header

* Fix rebase mistakes

* Drop prefix
This commit is contained in:
Duncan
2021-11-27 16:20:05 +00:00
committed by GitHub
parent bcb527d331
commit eba42a9584
25 changed files with 490 additions and 433 deletions

View File

@@ -124,7 +124,7 @@ void RideObject::ReadLegacy(IReadObjectContext* context, IStream* stream)
}
// Read peep loading positions
for (int32_t i = 0; i < RCT2_MAX_VEHICLES_PER_RIDE_ENTRY; i++)
for (int32_t i = 0; i < RCT2::Limits::MaxVehiclesPerRideEntry; i++)
{
_peepLoadingWaypoints[i].clear();
_peepLoadingPositions[i].clear();
@@ -198,7 +198,7 @@ void RideObject::Load()
_legacyType.vehicle_preset_list = &_presetColours;
int32_t cur_vehicle_images_offset = _legacyType.images_offset + MAX_RIDE_TYPES_PER_RIDE_ENTRY;
for (int32_t i = 0; i < RCT2_MAX_VEHICLES_PER_RIDE_ENTRY; i++)
for (int32_t i = 0; i < RCT2::Limits::MaxVehiclesPerRideEntry; i++)
{
rct_ride_entry_vehicle* vehicleEntry = &_legacyType.vehicles[i];
if (vehicleEntry->sprite_flags & VEHICLE_SPRITE_FLAG_FLAT)
@@ -410,11 +410,11 @@ void RideObject::SetRepositoryItem(ObjectRepositoryItem* item) const
uint8_t firstRideType = ride_entry_get_first_non_null_ride_type(&_legacyType);
uint8_t category = GetRideTypeDescriptor(firstRideType).Category;
for (int32_t i = 0; i < RCT2_MAX_RIDE_TYPES_PER_RIDE_ENTRY; i++)
for (int32_t i = 0; i < RCT2::Limits::MaxRideTypesPerRideEntry; i++)
{
item->RideInfo.RideType[i] = _legacyType.ride_type[i];
}
for (int32_t i = 0; i < RCT2_MAX_CATEGORIES_PER_RIDE; i++)
for (int32_t i = 0; i < RCT2::Limits::MaxCategoriesPerRide; i++)
{
item->RideInfo.RideCategory[i] = category;
}