diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 2531a66c25..9784d501b5 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -5788,7 +5788,7 @@ private: // Scale modifier if (listType == GRAPH_ALTITUDE) { - yUnit -= GetGameState().MapBaseZ * 3; + yUnit -= kMapBaseZ * 3; } for (int32_t y = widget->height() - 13; y >= 8; y -= yInterval, yUnit += yUnitInterval) diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index e1229b3a95..14dbfe821e 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -66,7 +66,6 @@ namespace OpenRCT2 uint8_t BankLoanInterestRate; money64 MaxBankLoan; random_engine_t ScenarioRand; - int32_t MapBaseZ; TileCoordsXY MapSize; SCENARIO_CATEGORY ScenarioCategory; diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index 6ba8fb5a2a..a865575f97 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -347,7 +347,7 @@ static void PaintHeightMarkers(PaintSession& session, const EntranceElement& ent ImageIndex baseImageIndex = SPR_HEIGHT_MARKER_BASE; baseImageIndex += heightMarkerBaseZ / 16; baseImageIndex += GetHeightMarkerOffset(); - baseImageIndex -= GetGameState().MapBaseZ; + baseImageIndex -= kMapBaseZ; auto imageId = ImageId(baseImageIndex, COLOUR_GREY); PaintAddImageAsParent(session, imageId, { 16, 16, height }, { { 31, 31, heightMarkerBaseZ + 64 }, { 1, 1, 0 } }); } diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 6cddd3631f..85c4266deb 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -761,7 +761,7 @@ static void PaintHeightMarkers(PaintSession& session, const PathElement& pathEl) uint32_t baseImageIndex = SPR_HEIGHT_MARKER_BASE; baseImageIndex += heightMarkerBaseZ / 16; baseImageIndex += GetHeightMarkerOffset(); - baseImageIndex -= GetGameState().MapBaseZ; + baseImageIndex -= kMapBaseZ; auto imageId = ImageId(baseImageIndex, COLOUR_GREY); PaintAddImageAsParent(session, imageId, { 16, 16, heightMarkerBaseZ }, { 1, 1, 0 }); } diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index 4e535c7a0f..e872b87b9f 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -1132,7 +1132,7 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con int32_t image_id = (SPR_HEIGHT_MARKER_BASE + dx / 16); image_id += GetHeightMarkerOffset(); - image_id -= OpenRCT2::GetGameState().MapBaseZ; + image_id -= kMapBaseZ; PaintAddImageAsParent(session, ImageId(image_id, COLOUR_OLIVE_GREEN), { 16, 16, surfaceHeight }, { 1, 1, 0 }); } diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index f1a896458f..c504d03540 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1500,8 +1500,6 @@ namespace RCT1 void ImportTileElements() { - GetGameState().MapBaseZ = 7; - // Build tile pointer cache (needed to get the first element at a certain location) auto tilePointerIndex = TilePointerIndex( Limits::MaxMapSize, _s4.TileElements, std::size(_s4.TileElements)); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 58cdcbb10b..954ece5a05 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -410,7 +410,6 @@ namespace RCT2 // rct1_water_colour // Pad01358842 ImportResearchList(gameState); - gameState.MapBaseZ = _s6.MapBaseZ; gameState.BankLoanInterestRate = _s6.CurrentInterestRate; // Pad0135934B // Preserve compatibility with vanilla RCT2's save format. diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 76ce08c9a4..e8a77091ec 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -2235,7 +2235,7 @@ void PaintTrack(PaintSession& session, Direction direction, int32_t height, cons uint16_t ax = ride->GetRideTypeDescriptor().Heights.VehicleZOffset; // 0x1689 represents 0 height there are -127 to 128 heights above and below it // There are 3 arrays of 256 heights (units, m, ft) chosen with the GetHeightMarkerOffset() - auto heightNum = (height + 8) / 16 - GetGameState().MapBaseZ; + auto heightNum = (height + 8) / 16 - kMapBaseZ; auto imageId = ImageId(SPR_HEIGHT_MARKER_BASE + GetHeightMarkerOffset() + heightNum, COLOUR_LIGHT_BLUE); PaintAddImageAsParent(session, imageId, { 16, 16, height + ax + 3 }, { { 1000, 1000, 2047 }, { 1, 1, 0 } }); diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 3cdb9ba1bf..b501fca43d 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -464,7 +464,6 @@ void MapInit(const TileCoordsXY& size) gGrassSceneryTileLoopPosition = 0; gWidePathTileLoopPosition = {}; gameState.MapSize = size; - gameState.MapBaseZ = 7; MapRemoveOutOfRangeElements(); MapAnimationAutoCreate(); diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 2a29ce9f88..0aa3fffa29 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -20,6 +20,10 @@ constexpr uint8_t MINIMUM_LAND_HEIGHT = 2; constexpr uint8_t MAXIMUM_LAND_HEIGHT = 254; constexpr uint8_t MINIMUM_WATER_HEIGHT = 2; constexpr uint8_t MAXIMUM_WATER_HEIGHT = 254; +/** + * The land height that counts as 0 metres/feet for the land height labels and altitude graphs. + */ +constexpr uint8_t kMapBaseZ = 7; #define MINIMUM_MAP_SIZE_TECHNICAL 5 #define MAXIMUM_MAP_SIZE_TECHNICAL 1001