1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 06:44:38 +01:00

Refactor map size to allow for rectangle maps

This commit is contained in:
Ted John
2021-12-17 18:25:46 +00:00
parent b22ac0551c
commit 454bfb0a8f
46 changed files with 212 additions and 205 deletions

View File

@@ -1993,10 +1993,10 @@ static bool TrackDesignPlacePreview(TrackDesignState& tds, TrackDesign* td6, mon
uint8_t backup_rotation = _currentTrackPieceDirection;
uint32_t backup_park_flags = gParkFlags;
gParkFlags &= ~PARK_FLAGS_FORBID_HIGH_CONSTRUCTION;
int32_t mapSize = gMapSize << 4;
auto mapSize = TileCoordsXY{ gMapSize.x / 16, gMapSize.y / 16 };
_currentTrackPieceDirection = 0;
int32_t z = TrackDesignGetZPlacement(tds, td6, GetOrAllocateRide(PreviewRideId), { mapSize, mapSize, 16 });
int32_t z = TrackDesignGetZPlacement(tds, td6, GetOrAllocateRide(PreviewRideId), { mapSize.x, mapSize.y, 16 });
if (tds.HasScenery)
{
@@ -2013,7 +2013,7 @@ static bool TrackDesignPlacePreview(TrackDesignState& tds, TrackDesign* td6, mon
}
auto res = TrackDesignPlaceVirtual(
tds, td6, PTD_OPERATION_PLACE_TRACK_PREVIEW, placeScenery, ride, { mapSize, mapSize, z });
tds, td6, PTD_OPERATION_PLACE_TRACK_PREVIEW, placeScenery, ride, { mapSize.x, mapSize.y, z });
gParkFlags = backup_park_flags;
if (res.Error == GameActions::Status::Ok)
@@ -2148,7 +2148,7 @@ static void TrackDesignPreviewClearMap()
{
auto numTiles = MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL;
gMapSize = 256;
gMapSize = { 256, 256 };
// Reserve ~8 elements per tile
std::vector<TileElement> tileElements;