mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 06:23:04 +01:00
Clean up RCT1/2 constants (#10855)
This commit is contained in:
committed by
GitHub
parent
904cad77b5
commit
d64b73c29a
@@ -19,15 +19,14 @@
|
||||
#include "../world/MapAnimation.h"
|
||||
#include "../world/Sprite.h"
|
||||
|
||||
#define RCT1_MAX_TILE_ELEMENTS 0xC000
|
||||
#define RCT1_MAX_SPRITES 5000
|
||||
#define RCT1_MAX_TRAINS_PER_RIDE 12
|
||||
#define RCT1_MAX_MAP_SIZE 128
|
||||
#define RCT1_MAX_RIDES_IN_PARK 128
|
||||
#define RCT1_MAX_STAFF 116
|
||||
#define RCT1_RESEARCH_FLAGS_SEPARATOR 0xFF
|
||||
#define RCT1_MAX_ANIMATED_OBJECTS 1000
|
||||
#define RCT1_MAX_BANNERS 100
|
||||
constexpr const uint16_t RCT1_MAX_TILE_ELEMENTS = 0xC000;
|
||||
constexpr const uint16_t RCT1_MAX_SPRITES = 5000;
|
||||
constexpr const uint8_t RCT1_MAX_TRAINS_PER_RIDE = 12;
|
||||
constexpr const uint8_t RCT1_MAX_MAP_SIZE = 128;
|
||||
constexpr const uint8_t RCT1_MAX_STAFF = 116;
|
||||
constexpr const uint8_t RCT1_RESEARCH_FLAGS_SEPARATOR = 0xFF;
|
||||
constexpr const uint16_t RCT1_MAX_ANIMATED_OBJECTS = 1000;
|
||||
constexpr const uint8_t RCT1_MAX_BANNERS = 100;
|
||||
constexpr int32_t RCT1_COORDS_Z_STEP = 4;
|
||||
|
||||
struct ParkLoadResult;
|
||||
|
||||
@@ -72,7 +72,7 @@ uint8_t RCT12SurfaceElement::GetOwnership() const
|
||||
|
||||
uint32_t RCT12SurfaceElement::GetWaterHeight() const
|
||||
{
|
||||
return (terrain & TILE_ELEMENT_SURFACE_WATER_HEIGHT_MASK) * 16;
|
||||
return (terrain & RCT12_TILE_ELEMENT_SURFACE_WATER_HEIGHT_MASK) * 16;
|
||||
}
|
||||
|
||||
uint8_t RCT12SurfaceElement::GetParkFences() const
|
||||
@@ -566,7 +566,7 @@ void RCT12SurfaceElement::SetEdgeStyle(uint32_t newStyle)
|
||||
type &= ~128;
|
||||
|
||||
// Bits 0, 1, 2 for terrain are stored in element.slope bit 5, 6, 7
|
||||
slope &= ~TILE_ELEMENT_SURFACE_EDGE_STYLE_MASK;
|
||||
slope &= ~RCT12_TILE_ELEMENT_SURFACE_EDGE_STYLE_MASK;
|
||||
slope |= (newStyle & 7) << 5;
|
||||
}
|
||||
|
||||
@@ -574,7 +574,7 @@ void RCT12SurfaceElement::SetWaterHeight(uint32_t newWaterHeight)
|
||||
{
|
||||
newWaterHeight >>= 4;
|
||||
newWaterHeight &= 0x1F;
|
||||
terrain &= ~TILE_ELEMENT_SURFACE_WATER_HEIGHT_MASK;
|
||||
terrain &= ~RCT12_TILE_ELEMENT_SURFACE_WATER_HEIGHT_MASK;
|
||||
terrain |= newWaterHeight;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,32 +17,32 @@
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#define RCT12_MAX_RIDES_IN_PARK 255
|
||||
#define RCT12_MAX_AWARDS 4
|
||||
#define RCT12_MAX_NEWS_ITEMS 61
|
||||
#define RCT12_MAX_STATIONS_PER_RIDE 4
|
||||
#define RCT12_MAX_PEEP_SPAWNS 2
|
||||
#define RCT12_MAX_PARK_ENTRANCES 4
|
||||
constexpr const uint8_t RCT12_MAX_RIDES_IN_PARK = 255;
|
||||
constexpr const uint8_t RCT12_MAX_AWARDS = 4;
|
||||
constexpr const uint8_t RCT12_MAX_NEWS_ITEMS = 61;
|
||||
constexpr const uint8_t RCT12_MAX_STATIONS_PER_RIDE = 4;
|
||||
constexpr const uint8_t RCT12_MAX_PEEP_SPAWNS = 2;
|
||||
constexpr const uint8_t RCT12_MAX_PARK_ENTRANCES = 4;
|
||||
// The number of elements in the patrol_areas array per staff member. Every bit in the array represents a 4x4 square.
|
||||
// In RCT1, that's an 8-bit array. 8 * 128 = 1024 bits, which is also the number of 4x4 squares on a 128x128 map.
|
||||
// For RCT2, it's a 32-bit array. 32 * 128 = 4096 bits, which is also the number of 4x4 squares on a 256x256 map.
|
||||
#define RCT12_PATROL_AREA_SIZE 128
|
||||
#define RCT12_STAFF_TYPE_COUNT 4
|
||||
#define RCT12_NUM_COLOUR_SCHEMES 4
|
||||
#define RCT12_MAX_VEHICLE_COLOURS 32
|
||||
#define RCT12_SOUND_ID_NULL 0xFF
|
||||
constexpr const uint8_t RCT12_PATROL_AREA_SIZE = 128;
|
||||
constexpr const uint8_t RCT12_STAFF_TYPE_COUNT = 4;
|
||||
constexpr const uint8_t RCT12_NUM_COLOUR_SCHEMES = 4;
|
||||
constexpr const uint8_t RCT12_MAX_VEHICLE_COLOURS = 32;
|
||||
constexpr const uint8_t RCT12_SOUND_ID_NULL = 0xFF;
|
||||
|
||||
#define RCT12_EXPENDITURE_TABLE_MONTH_COUNT 16
|
||||
#define RCT12_EXPENDITURE_TYPE_COUNT 14
|
||||
#define RCT12_FINANCE_GRAPH_SIZE 128
|
||||
constexpr const uint8_t RCT12_EXPENDITURE_TABLE_MONTH_COUNT = 16;
|
||||
constexpr const uint8_t RCT12_EXPENDITURE_TYPE_COUNT = 14;
|
||||
constexpr const uint8_t RCT12_FINANCE_GRAPH_SIZE = 128;
|
||||
|
||||
#define RCT12_MAX_USER_STRINGS 1024
|
||||
#define RCT12_USER_STRING_MAX_LENGTH 32
|
||||
constexpr const uint16_t RCT12_MAX_USER_STRINGS = 1024;
|
||||
constexpr const uint8_t RCT12_USER_STRING_MAX_LENGTH = 32;
|
||||
|
||||
#define RCT12_PEEP_MAX_THOUGHTS 5
|
||||
constexpr const uint8_t RCT12_PEEP_MAX_THOUGHTS = 5;
|
||||
|
||||
#define RCT12_RIDE_ID_NULL 255
|
||||
#define RCT12_RIDE_MEASUREMENT_MAX_ITEMS 4800
|
||||
constexpr const uint8_t RCT12_RIDE_ID_NULL = 255;
|
||||
constexpr const uint16_t RCT12_RIDE_MEASUREMENT_MAX_ITEMS = 4800;
|
||||
|
||||
constexpr uint16_t const RCT12_MAX_INVERSIONS = 31;
|
||||
constexpr uint16_t const RCT12_MAX_GOLF_HOLES = 31;
|
||||
@@ -50,6 +50,10 @@ constexpr uint16_t const RCT12_MAX_HELICES = 31;
|
||||
|
||||
constexpr uint8_t RCT12_BANNER_INDEX_NULL = std::numeric_limits<uint8_t>::max();
|
||||
|
||||
constexpr const uint8_t RCT12_TILE_ELEMENT_SURFACE_EDGE_STYLE_MASK = 0xE0; // in RCT12TileElement.properties.surface.slope
|
||||
constexpr const uint8_t RCT12_TILE_ELEMENT_SURFACE_WATER_HEIGHT_MASK = 0x1F; // in RCT12TileElement.properties.surface.terrain
|
||||
constexpr const uint8_t RCT12_TILE_ELEMENT_SURFACE_TERRAIN_MASK = 0xE0; // in RCT12TileElement.properties.surface.terrain
|
||||
|
||||
constexpr uint16_t const RCT12_XY8_UNDEFINED = 0xFFFF;
|
||||
|
||||
// Everything before this point has been researched
|
||||
|
||||
@@ -16,22 +16,26 @@
|
||||
#include "../ride/Vehicle.h"
|
||||
#include "../world/Location.hpp"
|
||||
|
||||
#define RCT2_MAX_STAFF 200
|
||||
#define RCT2_MAX_BANNERS_IN_PARK 250
|
||||
#define RCT2_MAX_VEHICLES_PER_RIDE 31
|
||||
#define RCT2_MAX_CARS_PER_TRAIN 32
|
||||
#define RCT2_MAX_CATEGORIES_PER_RIDE 2
|
||||
#define RCT2_MAX_RIDE_TYPES_PER_RIDE_ENTRY 3
|
||||
#define RCT2_MAX_VEHICLES_PER_RIDE_ENTRY 4
|
||||
#define RCT2_DOWNTIME_HISTORY_SIZE 8
|
||||
#define RCT2_CUSTOMER_HISTORY_SIZE 10
|
||||
#define RCT2_MAX_SPRITES 10000
|
||||
#define RCT2_MAX_TILE_ELEMENTS 0x30000
|
||||
#define RCT2_MAX_ANIMATED_OBJECTS 2000
|
||||
#define RCT2_MAX_RESEARCHED_RIDE_TYPE_QUADS 8 // With 32 bits per uint32_t, this means there is room for 256 types.
|
||||
#define RCT2_MAX_RESEARCHED_RIDE_ENTRY_QUADS 8 // With 32 bits per uint32_t, this means there is room for 256 entries.
|
||||
#define RCT2_MAX_RESEARCHED_SCENERY_ITEM_QUADS 56
|
||||
#define RCT2_MAX_RESEARCHED_SCENERY_ITEMS (RCT2_MAX_RESEARCHED_SCENERY_ITEM_QUADS * 32) // There are 32 bits per quad.
|
||||
constexpr const uint8_t RCT2_MAX_STAFF = 200;
|
||||
constexpr const uint8_t RCT2_MAX_BANNERS_IN_PARK = 250;
|
||||
constexpr const uint8_t RCT2_MAX_VEHICLES_PER_RIDE = 31;
|
||||
constexpr const uint8_t RCT2_MAX_CARS_PER_TRAIN = 32;
|
||||
constexpr const uint8_t RCT2_MAX_CATEGORIES_PER_RIDE = 2;
|
||||
constexpr const uint8_t RCT2_MAX_RIDE_TYPES_PER_RIDE_ENTRY = 3;
|
||||
constexpr const uint8_t RCT2_MAX_VEHICLES_PER_RIDE_ENTRY = 4;
|
||||
constexpr const uint8_t RCT2_DOWNTIME_HISTORY_SIZE = 8;
|
||||
constexpr const uint8_t RCT2_CUSTOMER_HISTORY_SIZE = 10;
|
||||
constexpr const uint16_t RCT2_MAX_SPRITES = 10000;
|
||||
constexpr const uint32_t RCT2_MAX_TILE_ELEMENTS = 0x30000;
|
||||
constexpr const uint16_t RCT2_MAX_ANIMATED_OBJECTS = 2000;
|
||||
constexpr const uint8_t RCT2_MAX_RESEARCHED_RIDE_TYPE_QUADS = 8; // With 32 bits per uint32_t, this means there is room for 256
|
||||
// types.
|
||||
constexpr const uint8_t RCT2_MAX_RESEARCHED_RIDE_ENTRY_QUADS = 8; // With 32 bits per uint32_t, this means there is room for 256
|
||||
// entries.
|
||||
constexpr const uint8_t RCT2_MAX_RESEARCHED_SCENERY_ITEM_QUADS = 56;
|
||||
constexpr const uint16_t RCT2_MAX_RESEARCHED_SCENERY_ITEMS = (RCT2_MAX_RESEARCHED_SCENERY_ITEM_QUADS * 32); // There are 32 bits
|
||||
// per quad.
|
||||
constexpr uint16_t TD6MaxTrackElements = 8192;
|
||||
|
||||
constexpr const uint8_t RCT2_MAX_RIDE_OBJECTS = 128;
|
||||
constexpr const uint8_t RCT2_MAX_SMALL_SCENERY_OBJECTS = 252;
|
||||
|
||||
@@ -246,9 +246,6 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride)
|
||||
break;
|
||||
}
|
||||
|
||||
// TODO move to RCT2 limit
|
||||
constexpr auto TD6MaxTrackElements = 8192;
|
||||
|
||||
if (track_elements.size() > TD6MaxTrackElements)
|
||||
{
|
||||
return STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY;
|
||||
|
||||
@@ -107,9 +107,6 @@ enum
|
||||
#define TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK 0x0F // in TileElement.properties.surface.slope
|
||||
#define TILE_ELEMENT_SURFACE_SLOPE_MASK \
|
||||
(TILE_ELEMENT_SURFACE_DIAGONAL_FLAG | TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK) // in TileElement.properties.surface.slope
|
||||
#define TILE_ELEMENT_SURFACE_EDGE_STYLE_MASK 0xE0 // in TileElement.properties.surface.slope
|
||||
#define TILE_ELEMENT_SURFACE_WATER_HEIGHT_MASK 0x1F // in TileElement.properties.surface.terrain
|
||||
#define TILE_ELEMENT_SURFACE_TERRAIN_MASK 0xE0 // in TileElement.properties.surface.terrain
|
||||
|
||||
#define TILE_ELEMENT_SURFACE_OWNERSHIP_MASK 0xF0
|
||||
#define TILE_ELEMENT_SURFACE_PARK_FENCE_MASK 0x0F
|
||||
|
||||
Reference in New Issue
Block a user