From ffb8b4d44bd00cbfec19273b36a1d39d1f99e84c Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Sun, 17 Mar 2024 14:41:36 +0100 Subject: [PATCH] Part of #21421: Refactor MAXIMUM_MAP_SIZE_TECHNICAL --- src/openrct2-ui/windows/Map.cpp | 22 ++++++++++---------- src/openrct2-ui/windows/MapGen.cpp | 4 ++-- src/openrct2-ui/windows/RideConstruction.cpp | 2 +- src/openrct2-ui/windows/TileInspector.cpp | 8 +++---- src/openrct2/Game.cpp | 4 ++-- src/openrct2/actions/MapChangeSizeAction.cpp | 2 +- src/openrct2/entity/EntityRegistry.cpp | 6 +++--- src/openrct2/entity/PatrolArea.h | 6 +++--- src/openrct2/paint/Paint.h | 4 ++-- src/openrct2/rct1/S4Importer.cpp | 4 ++-- src/openrct2/rct2/S6Importer.cpp | 4 ++-- src/openrct2/ride/TrackDesign.cpp | 2 +- src/openrct2/world/Map.cpp | 20 +++++++++--------- src/openrct2/world/Map.h | 10 ++++----- 14 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index b2afdc70a1..720a98fdf2 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -55,7 +55,7 @@ namespace OpenRCT2::Ui::Windows return MapColour2((colour & 0xFF00) >> 8, PALETTE_INDEX_10); } - constexpr int32_t MAP_WINDOW_MAP_SIZE = MAXIMUM_MAP_SIZE_TECHNICAL * 2; + constexpr int32_t MAP_WINDOW_MAP_SIZE = kMaximumMapSizeTechnical * 2; static constexpr StringId WINDOW_TITLE = STR_MAP_LABEL; static constexpr int32_t WH = 259; @@ -131,10 +131,10 @@ static Widget window_map_widgets[] = { // used in transforming viewport view coordinates to minimap coordinates // rct2: 0x00981BBC static constexpr ScreenCoordsXY MiniMapOffsets[] = { - { MAXIMUM_MAP_SIZE_TECHNICAL - 8, 0 }, - { 2 * MAXIMUM_MAP_SIZE_TECHNICAL - 8, MAXIMUM_MAP_SIZE_TECHNICAL }, - { MAXIMUM_MAP_SIZE_TECHNICAL - 8, 2 * MAXIMUM_MAP_SIZE_TECHNICAL }, - { 0 - 8, MAXIMUM_MAP_SIZE_TECHNICAL }, + { kMaximumMapSizeTechnical - 8, 0 }, + { 2 * kMaximumMapSizeTechnical - 8, kMaximumMapSizeTechnical }, + { kMaximumMapSizeTechnical - 8, 2 * kMaximumMapSizeTechnical }, + { 0 - 8, kMaximumMapSizeTechnical }, }; // clang-format on @@ -691,7 +691,7 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { { // The practical size is 2 lower than the technical size size += 2; - size = std::clamp(size, kMinimumMapSizeTechnical, MAXIMUM_MAP_SIZE_TECHNICAL); + size = std::clamp(size, static_cast(kMinimumMapSizeTechnical), static_cast(kMaximumMapSizeTechnical)); TileCoordsXY newMapSize = GetGameState().MapSize; if (_resizeDirection != ResizeDirection::X) @@ -1069,7 +1069,7 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { { int32_t x = 0, y = 0, dx = 0, dy = 0; - int32_t pos = (_currentLine * (MAP_WINDOW_MAP_SIZE - 1)) + MAXIMUM_MAP_SIZE_TECHNICAL - 1; + int32_t pos = (_currentLine * (MAP_WINDOW_MAP_SIZE - 1)) + kMaximumMapSizeTechnical - 1; auto destinationPosition = ScreenCoordsXY{ pos % MAP_WINDOW_MAP_SIZE, pos / MAP_WINDOW_MAP_SIZE }; auto destination = _mapImageData.data() + (destinationPosition.y * MAP_WINDOW_MAP_SIZE) + destinationPosition.x; switch (GetCurrentRotation()) @@ -1100,7 +1100,7 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { break; } - for (int32_t i = 0; i < MAXIMUM_MAP_SIZE_TECHNICAL; i++) + for (int32_t i = 0; i < kMaximumMapSizeTechnical; i++) { if (!MapIsEdge({ x, y })) { @@ -1125,7 +1125,7 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { destination = _mapImageData.data() + (destinationPosition.y * MAP_WINDOW_MAP_SIZE) + destinationPosition.x; } _currentLine++; - if (_currentLine >= MAXIMUM_MAP_SIZE_TECHNICAL) + if (_currentLine >= kMaximumMapSizeTechnical) _currentLine = 0; } @@ -1414,7 +1414,7 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { CoordsXY ScreenToMap(ScreenCoordsXY screenCoords) { - screenCoords.x = ((screenCoords.x + 8) - MAXIMUM_MAP_SIZE_TECHNICAL) / 2; + screenCoords.x = ((screenCoords.x + 8) - kMaximumMapSizeTechnical) / 2; screenCoords.y = ((screenCoords.y + 8)) / 2; auto location = TileCoordsXY(screenCoords.y - screenCoords.x, screenCoords.x + screenCoords.y).ToCoordsXY(); @@ -1457,7 +1457,7 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { x /= 32; y /= 32; - return { -x + y + MAXIMUM_MAP_SIZE_TECHNICAL - 8, x + y - 8 }; + return { -x + y + kMaximumMapSizeTechnical - 8, x + y - 8 }; } void ResizeMap() diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 791b07afb6..da06a46037 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -405,9 +405,9 @@ static uint64_t PressedWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { _resizeDirection = ResizeDirection::Both; if (_resizeDirection != ResizeDirection::X) - _mapSize.y = std::clamp(_mapSize.y + sizeOffset, kMinimumMapSizeTechnical, MAXIMUM_MAP_SIZE_TECHNICAL); + _mapSize.y = std::clamp(_mapSize.y + sizeOffset, static_cast(kMinimumMapSizeTechnical), static_cast(kMaximumMapSizeTechnical)); if (_resizeDirection != ResizeDirection::Y) - _mapSize.x = std::clamp(_mapSize.x + sizeOffset, kMinimumMapSizeTechnical, MAXIMUM_MAP_SIZE_TECHNICAL); + _mapSize.x = std::clamp(_mapSize.x + sizeOffset, static_cast(kMinimumMapSizeTechnical), static_cast(kMaximumMapSizeTechnical)); } void InputMapSize(WidgetIndex callingWidget, int32_t currentValue) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index f3ce047542..da0e4f13d1 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2628,7 +2628,7 @@ static Widget _rideConstructionWidgets[] = { auto& gameState = OpenRCT2::GetGameState(); auto preserveMapSize = gameState.MapSize; - gameState.MapSize = { MAXIMUM_MAP_SIZE_TECHNICAL, MAXIMUM_MAP_SIZE_TECHNICAL }; + gameState.MapSize = { kMaximumMapSizeTechnical, kMaximumMapSizeTechnical }; // Setup non changing parts of the temporary track tile element tempTrackTileElement.SetType(TileElementType::Track); diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index ebdff373d5..569df05ada 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -742,7 +742,7 @@ static uint64_t PageDisabledWidgets[] = { { case WIDX_SPINNER_X_INCREASE: windowTileInspectorTile.x = std::min( - windowTileInspectorTile.x + 1, MAXIMUM_MAP_SIZE_TECHNICAL - 1); + windowTileInspectorTile.x + 1, kMaximumMapSizeTechnical - 1); _toolMap.x = std::min(_toolMap.x + 32, MAXIMUM_TILE_START_XY); LoadTile(nullptr); break; @@ -755,7 +755,7 @@ static uint64_t PageDisabledWidgets[] = { case WIDX_SPINNER_Y_INCREASE: windowTileInspectorTile.y = std::min( - windowTileInspectorTile.y + 1, MAXIMUM_MAP_SIZE_TECHNICAL - 1); + windowTileInspectorTile.y + 1, kMaximumMapSizeTechnical - 1); _toolMap.y = std::min(_toolMap.y + 32, MAXIMUM_TILE_START_XY); LoadTile(nullptr); break; @@ -2075,10 +2075,10 @@ static uint64_t PageDisabledWidgets[] = { } // X and Y spinners SetWidgetDisabledAndInvalidate( - WIDX_SPINNER_X_INCREASE, !(_tileSelected && ((_toolMap.x / 32) < MAXIMUM_MAP_SIZE_TECHNICAL - 1))); + WIDX_SPINNER_X_INCREASE, !(_tileSelected && ((_toolMap.x / 32) < kMaximumMapSizeTechnical - 1))); SetWidgetDisabledAndInvalidate(WIDX_SPINNER_X_DECREASE, !(_tileSelected && ((_toolMap.x / 32) > 0))); SetWidgetDisabledAndInvalidate( - WIDX_SPINNER_Y_INCREASE, !(_tileSelected && ((_toolMap.y / 32) < MAXIMUM_MAP_SIZE_TECHNICAL - 1))); + WIDX_SPINNER_Y_INCREASE, !(_tileSelected && ((_toolMap.y / 32) < kMaximumMapSizeTechnical - 1))); SetWidgetDisabledAndInvalidate(WIDX_SPINNER_Y_DECREASE, !(_tileSelected && ((_toolMap.y / 32) > 0))); // Sort buttons diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index c7c857e031..bc2e86661b 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -450,9 +450,9 @@ static void FixInvalidSurfaces() // Fixes broken saves where a surface element could be null // and broken saves with incorrect invisible map border tiles - for (int32_t y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) + for (int32_t y = 0; y < kMaximumMapSizeTechnical; y++) { - for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) + for (int32_t x = 0; x < kMaximumMapSizeTechnical; x++) { auto* surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }); diff --git a/src/openrct2/actions/MapChangeSizeAction.cpp b/src/openrct2/actions/MapChangeSizeAction.cpp index bcd6b1a433..1c5bf1fc75 100644 --- a/src/openrct2/actions/MapChangeSizeAction.cpp +++ b/src/openrct2/actions/MapChangeSizeAction.cpp @@ -35,7 +35,7 @@ void MapChangeSizeAction::Serialise(DataSerialiser& stream) GameActions::Result MapChangeSizeAction::Query() const { - if (_targetSize.x > MAXIMUM_MAP_SIZE_TECHNICAL || _targetSize.y > MAXIMUM_MAP_SIZE_TECHNICAL) + if (_targetSize.x > kMaximumMapSizeTechnical || _targetSize.y > kMaximumMapSizeTechnical) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_INCREASE_MAP_SIZE_ANY_FURTHER, STR_NONE); } diff --git a/src/openrct2/entity/EntityRegistry.cpp b/src/openrct2/entity/EntityRegistry.cpp index 47f50f8afe..2567d24e76 100644 --- a/src/openrct2/entity/EntityRegistry.cpp +++ b/src/openrct2/entity/EntityRegistry.cpp @@ -44,7 +44,7 @@ static std::vector _freeIdList; static bool _entityFlashingList[MAX_ENTITIES]; -constexpr const uint32_t SPATIAL_INDEX_SIZE = (MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL) + 1; +constexpr const uint32_t SPATIAL_INDEX_SIZE = (kMaximumMapSizeTechnical * kMaximumMapSizeTechnical) + 1; constexpr uint32_t SPATIAL_INDEX_LOCATION_NULL = SPATIAL_INDEX_SIZE - 1; static std::array, SPATIAL_INDEX_SIZE> gEntitySpatialIndex; @@ -60,10 +60,10 @@ static constexpr size_t GetSpatialIndexOffset(const CoordsXY& loc) const auto tileX = std::abs(loc.x) / COORDS_XY_STEP; const auto tileY = std::abs(loc.y) / COORDS_XY_STEP; - if (tileX >= MAXIMUM_MAP_SIZE_TECHNICAL || tileY >= MAXIMUM_MAP_SIZE_TECHNICAL) + if (tileX >= kMaximumMapSizeTechnical || tileY >= kMaximumMapSizeTechnical) return SPATIAL_INDEX_LOCATION_NULL; - return tileX * MAXIMUM_MAP_SIZE_TECHNICAL + tileY; + return tileX * kMaximumMapSizeTechnical + tileY; } constexpr bool EntityTypeIsMiscEntity(const EntityType type) diff --git a/src/openrct2/entity/PatrolArea.h b/src/openrct2/entity/PatrolArea.h index ded2ec1fbe..053df61c58 100644 --- a/src/openrct2/entity/PatrolArea.h +++ b/src/openrct2/entity/PatrolArea.h @@ -17,7 +17,7 @@ // The number of elements in the GameState_t.StaffPatrolAreas array per staff member. Every bit in the array represents a 4x4 // square. Right now, it's a 32-bit array like in RCT2. 32 * 128 = 4096 bits, which is also the number of 4x4 squares on a // 256x256 map. -constexpr size_t STAFF_PATROL_AREA_BLOCKS_PER_LINE = MAXIMUM_MAP_SIZE_TECHNICAL / 4; +constexpr size_t STAFF_PATROL_AREA_BLOCKS_PER_LINE = kMaximumMapSizeTechnical / 4; constexpr size_t STAFF_PATROL_AREA_SIZE = (STAFF_PATROL_AREA_BLOCKS_PER_LINE * STAFF_PATROL_AREA_BLOCKS_PER_LINE) / 32; class PatrolArea @@ -32,8 +32,8 @@ private: std::vector SortedTiles; }; - static constexpr auto CellColumns = (MAXIMUM_MAP_SIZE_TECHNICAL + (Cell::Width - 1)) / Cell::Width; - static constexpr auto CellRows = (MAXIMUM_MAP_SIZE_TECHNICAL + (Cell::Height - 1)) / Cell::Height; + static constexpr auto CellColumns = (kMaximumMapSizeTechnical + (Cell::Width - 1)) / Cell::Width; + static constexpr auto CellRows = (kMaximumMapSizeTechnical + (Cell::Height - 1)) / Cell::Height; static constexpr auto NumCells = CellColumns * CellRows; std::array Areas; diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 3bd4dc19e8..b958bcc304 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -121,9 +121,9 @@ struct TunnelEntry uint8_t type; }; -// The maximum size must be MAXIMUM_MAP_SIZE_TECHNICAL multiplied by 2 because +// The maximum size must be kMaximumMapSizeTechnical multiplied by 2 because // the quadrant index is based on the x and y components combined. -static constexpr int32_t MaxPaintQuadrants = MAXIMUM_MAP_SIZE_TECHNICAL * 2; +static constexpr int32_t MaxPaintQuadrants = kMaximumMapSizeTechnical * 2; #define TUNNEL_MAX_COUNT 65 diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index be2f25b2f5..725ad9abee 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1528,9 +1528,9 @@ namespace RCT1 std::vector tileElements; const auto maxSize = _s4.MapSize == 0 ? Limits::MaxMapSize : _s4.MapSize; - for (TileCoordsXY coords = { 0, 0 }; coords.y < MAXIMUM_MAP_SIZE_TECHNICAL; coords.y++) + for (TileCoordsXY coords = { 0, 0 }; coords.y < kMaximumMapSizeTechnical; coords.y++) { - for (coords.x = 0; coords.x < MAXIMUM_MAP_SIZE_TECHNICAL; coords.x++) + for (coords.x = 0; coords.x < kMaximumMapSizeTechnical; coords.x++) { auto tileAdded = false; if (coords.x < maxSize && coords.y < maxSize) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 6ead1df5e7..4a7d9f8811 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1802,9 +1802,9 @@ namespace RCT2 bool nextElementInvisible = false; bool restOfTileInvisible = false; const auto maxSize = std::min(Limits::MaxMapSize, _s6.MapSize); - for (TileCoordsXY coords = { 0, 0 }; coords.y < MAXIMUM_MAP_SIZE_TECHNICAL; coords.y++) + for (TileCoordsXY coords = { 0, 0 }; coords.y < kMaximumMapSizeTechnical; coords.y++) { - for (coords.x = 0; coords.x < MAXIMUM_MAP_SIZE_TECHNICAL; coords.x++) + for (coords.x = 0; coords.x < kMaximumMapSizeTechnical; coords.x++) { nextElementInvisible = false; restOfTileInvisible = false; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index deb4d3a898..bb066ab599 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -2098,7 +2098,7 @@ void TrackDesignDrawPreview(TrackDesign* td6, uint8_t* pixels) */ static void TrackDesignPreviewClearMap() { - auto numTiles = MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL; + auto numTiles = kMaximumMapSizeTechnical * kMaximumMapSizeTechnical; GetGameState().MapSize = TRACK_DESIGN_PREVIEW_MAP_SIZE; diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 7c32ab9dab..048420be30 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -152,7 +152,7 @@ void SetTileElements(std::vector&& tileElements) auto& gameState = GetGameState(); gameState.TileElements = std::move(tileElements); _tileIndex = TilePointerIndex( - MAXIMUM_MAP_SIZE_TECHNICAL, gameState.TileElements.data(), gameState.TileElements.size()); + kMaximumMapSizeTechnical, gameState.TileElements.data(), gameState.TileElements.size()); _tileElementsInUse = gameState.TileElements.size(); } @@ -177,9 +177,9 @@ std::vector GetReorganisedTileElementsWithoutGhosts() { std::vector newElements; newElements.reserve(std::max(MIN_TILE_ELEMENTS, GetGameState().TileElements.size())); - for (int32_t y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) + for (int32_t y = 0; y < kMaximumMapSizeTechnical; y++) { - for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) + for (int32_t x = 0; x < kMaximumMapSizeTechnical; x++) { auto oldSize = newElements.size(); @@ -217,9 +217,9 @@ static void ReorganiseTileElements(size_t capacity) std::vector newElements; newElements.reserve(std::max(MIN_TILE_ELEMENTS, capacity)); - for (int32_t y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) + for (int32_t y = 0; y < kMaximumMapSizeTechnical; y++) { - for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) + for (int32_t x = 0; x < kMaximumMapSizeTechnical; x++) { const auto* element = MapGetFirstElementAt(TileCoordsXY{ x, y }); if (element == nullptr) @@ -336,8 +336,8 @@ void TileElementIteratorRestartForTile(TileElementIterator* it) static bool IsTileLocationValid(const TileCoordsXY& coords) { - const bool is_x_valid = coords.x < MAXIMUM_MAP_SIZE_TECHNICAL && coords.x >= 0; - const bool is_y_valid = coords.y < MAXIMUM_MAP_SIZE_TECHNICAL && coords.y >= 0; + const bool is_x_valid = coords.x < kMaximumMapSizeTechnical && coords.x >= 0; + const bool is_y_valid = coords.y < kMaximumMapSizeTechnical && coords.y >= 0; return is_x_valid && is_y_valid; } @@ -454,7 +454,7 @@ BannerElement* MapGetBannerElementAt(const CoordsXYZ& bannerPos, uint8_t positio */ void MapInit(const TileCoordsXY& size) { - auto numTiles = MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL; + auto numTiles = kMaximumMapSizeTechnical * kMaximumMapSizeTechnical; SetTileElements(std::vector(numTiles, GetDefaultSurfaceElement())); auto& gameState = GetGameState(); @@ -1420,7 +1420,7 @@ static void MapExtendBoundarySurfaceExtendTile(const SurfaceElement& sourceTile, void MapExtendBoundarySurfaceY() { auto y = GetGameState().MapSize.y - 2; - for (auto x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) + for (auto x = 0; x < kMaximumMapSizeTechnical; x++) { auto existingTileElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y - 1 }); auto newTileElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }); @@ -1440,7 +1440,7 @@ void MapExtendBoundarySurfaceY() void MapExtendBoundarySurfaceX() { auto x = GetGameState().MapSize.x - 2; - for (auto y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) + for (auto y = 0; y < kMaximumMapSizeTechnical; y++) { auto existingTileElement = MapGetSurfaceElementAt(TileCoordsXY{ x - 1, y }); auto newTileElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }); diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 99afb700b1..184ec86314 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -26,10 +26,10 @@ constexpr uint8_t kMaximumWaterHeight = 254; constexpr uint8_t kMapBaseZ = 7; constexpr uint8_t kMinimumMapSizeTechnical{ 5 }; -#define MAXIMUM_MAP_SIZE_TECHNICAL 1001 +constexpr uint16_t kMaximumMapSizeTechnical{ 1001 }; #define MINIMUM_MAP_SIZE_PRACTICAL (kMinimumMapSizeTechnical - 2) -#define MAXIMUM_MAP_SIZE_PRACTICAL (MAXIMUM_MAP_SIZE_TECHNICAL - 2) -constexpr const int32_t MAXIMUM_MAP_SIZE_BIG = COORDS_XY_STEP * MAXIMUM_MAP_SIZE_TECHNICAL; +#define MAXIMUM_MAP_SIZE_PRACTICAL (kMaximumMapSizeTechnical - 2) +constexpr const int32_t MAXIMUM_MAP_SIZE_BIG = COORDS_XY_STEP * kMaximumMapSizeTechnical; constexpr int32_t MAXIMUM_TILE_START_XY = MAXIMUM_MAP_SIZE_BIG - COORDS_XY_STEP; constexpr const int32_t LAND_HEIGHT_STEP = 2 * COORDS_Z_STEP; constexpr const int32_t WATER_HEIGHT_STEP = 2 * COORDS_Z_STEP; @@ -40,11 +40,11 @@ constexpr uint8_t ConstructionRightsClearanceSmall = 3; // Same as previous, but in big coords. constexpr const uint8_t ConstructionRightsClearanceBig = 3 * COORDS_Z_STEP; -#define MAP_MINIMUM_X_Y (-MAXIMUM_MAP_SIZE_TECHNICAL) +#define MAP_MINIMUM_X_Y (-kMaximumMapSizeTechnical) constexpr uint32_t MAX_TILE_ELEMENTS_WITH_SPARE_ROOM = 0x1000000; constexpr uint32_t MAX_TILE_ELEMENTS = MAX_TILE_ELEMENTS_WITH_SPARE_ROOM - 512; -#define MAX_TILE_TILE_ELEMENT_POINTERS (MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL) +#define MAX_TILE_TILE_ELEMENT_POINTERS (kMaximumMapSizeTechnical * kMaximumMapSizeTechnical) #define TILE_UNDEFINED_TILE_ELEMENT NULL