From 448c8fafd099b1c936fe14e17ccaf5e89673063c Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Thu, 19 Jan 2023 20:36:30 +0100 Subject: [PATCH] Rename base_height, clearance_height and owner --- src/openrct2-ui/windows/RideConstruction.cpp | 4 +- src/openrct2-ui/windows/TileInspector.cpp | 20 ++--- src/openrct2-ui/windows/TopToolbar.cpp | 6 +- src/openrct2/actions/LandLowerAction.cpp | 4 +- src/openrct2/actions/LandRaiseAction.cpp | 2 +- src/openrct2/actions/LandSetHeightAction.cpp | 18 ++-- src/openrct2/actions/LandSetRightsAction.cpp | 4 +- src/openrct2/actions/LandSmoothAction.cpp | 12 +-- .../actions/SmallSceneryPlaceAction.cpp | 4 +- src/openrct2/actions/TrackRemoveAction.cpp | 4 +- src/openrct2/actions/WallPlaceAction.cpp | 12 +-- src/openrct2/actions/WaterRaiseAction.cpp | 4 +- src/openrct2/actions/WaterSetHeightAction.cpp | 2 +- src/openrct2/core/DataSerialiserTraits.h | 16 ++-- src/openrct2/entity/Peep.cpp | 10 +-- src/openrct2/entity/Staff.cpp | 8 +- .../paint/tile_element/Paint.Wall.cpp | 2 +- src/openrct2/peep/GuestPathfinding.cpp | 30 +++---- src/openrct2/rct1/S4Importer.cpp | 10 +-- src/openrct2/rct12/RCT12.h | 8 +- src/openrct2/rct2/RCT2.h | 2 +- src/openrct2/rct2/S6Importer.cpp | 8 +- src/openrct2/ride/Ride.cpp | 14 ++-- src/openrct2/ride/RideConstruction.cpp | 7 +- src/openrct2/ride/RideRatings.cpp | 36 ++++---- src/openrct2/ride/TrackDesign.cpp | 2 +- src/openrct2/ride/TrackDesignSave.cpp | 4 +- src/openrct2/ride/Vehicle.cpp | 2 +- src/openrct2/ride/gentle/MiniGolf.cpp | 2 +- src/openrct2/ride/transport/Chairlift.cpp | 6 +- .../bindings/world/ScTileElement.cpp | 8 +- src/openrct2/world/Banner.cpp | 2 +- src/openrct2/world/Entrance.cpp | 2 +- src/openrct2/world/Footpath.cpp | 14 ++-- src/openrct2/world/Map.cpp | 84 +++++++++---------- src/openrct2/world/MapAnimation.cpp | 26 +++--- src/openrct2/world/MapGen.cpp | 30 +++---- src/openrct2/world/MapHelpers.cpp | 54 ++++++------ src/openrct2/world/TileElement.cpp | 6 +- src/openrct2/world/TileElement.h | 10 +-- src/openrct2/world/TileElementBase.cpp | 14 ++-- src/openrct2/world/TileInspector.cpp | 30 +++---- 42 files changed, 271 insertions(+), 272 deletions(-) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 35f776a27f..4751514174 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2957,7 +2957,7 @@ static std::optional RideGetPlacePositionFromScreenPosition(ScreenCoor { if (gInputPlaceObjectModifier & PLACE_OBJECT_MODIFIER_SHIFT_Z) { - uint16_t maxHeight = ZoomLevel::max().ApplyTo(std::numeric_limits::max() - 32); + uint16_t maxHeight = ZoomLevel::max().ApplyTo(std::numeric_limits::max() - 32); _trackPlaceShiftZ = _trackPlaceShiftStart.y - screenCoords.y + 4; // Scale delta by zoom to match mouse position. @@ -2968,7 +2968,7 @@ static std::optional RideGetPlacePositionFromScreenPosition(ScreenCoor } _trackPlaceShiftZ = Floor2(_trackPlaceShiftZ, 8); - // Clamp to maximum possible value of base_height can offer. + // Clamp to maximum possible value of BaseHeight can offer. _trackPlaceShiftZ = std::min(_trackPlaceShiftZ, maxHeight); screenCoords = _trackPlaceShiftStart; diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 2971664a64..69c5f553b9 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -1095,7 +1095,7 @@ public: // Current base height screenCoords.x = windowPos.x + widgets[WIDX_SURFACE_SPINNER_HEIGHT].left + 3; ft = Formatter(); - ft.Add(tileElement->base_height); + ft.Add(tileElement->BaseHeight); DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); // Raised corners @@ -1169,7 +1169,7 @@ public: // Current base height screenCoords.x = windowPos.x + widgets[WIDX_PATH_SPINNER_HEIGHT].left + 3; auto ft = Formatter(); - ft.Add(tileElement->base_height); + ft.Add(tileElement->BaseHeight); DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); // Path connections @@ -1249,7 +1249,7 @@ public: // Current base height screenCoords.x = windowPos.x + widgets[WIDX_TRACK_SPINNER_HEIGHT].left + 3; ft = Formatter(); - ft.Add(tileElement->base_height); + ft.Add(tileElement->BaseHeight); DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); break; } @@ -1294,7 +1294,7 @@ public: // Current base height screenCoords.x = windowPos.x + widgets[WIDX_SCENERY_SPINNER_HEIGHT].left + 3; ft = Formatter(); - ft.Add(tileElement->base_height); + ft.Add(tileElement->BaseHeight); DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); // Quarter tile @@ -1378,7 +1378,7 @@ public: // Current base height screenCoords.x = windowPos.x + widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].left + 3; ft = Formatter(); - ft.Add(tileElement->base_height); + ft.Add(tileElement->BaseHeight); DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); break; } @@ -1416,7 +1416,7 @@ public: // Current base height screenCoords.x = windowPos.x + widgets[WIDX_WALL_SPINNER_HEIGHT].left + 3; ft = Formatter(); - ft.Add(tileElement->base_height); + ft.Add(tileElement->BaseHeight); DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); // Slope label @@ -1487,7 +1487,7 @@ public: // Current base height screenCoords.x = windowPos.x + widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].left + 3; ft = Formatter(); - ft.Add(tileElement->base_height); + ft.Add(tileElement->BaseHeight); DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); break; } @@ -1512,7 +1512,7 @@ public: // Current base height screenCoords.x = windowPos.x + widgets[WIDX_BANNER_SPINNER_HEIGHT].left + 3; auto ft = Formatter(); - ft.Add(tileElement->base_height); + ft.Add(tileElement->BaseHeight); DrawTextBasic(&dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); // Blocked paths @@ -1643,7 +1643,7 @@ public: typeName = buffer; } - const int32_t clearanceHeight = tileElement->clearance_height; + const int32_t clearanceHeight = tileElement->ClearanceHeight; const bool ghost = tileElement->IsGhost(); const bool last = tileElement->IsLastForTile(); @@ -1657,7 +1657,7 @@ public: // Base height ft = Formatter(); ft.Add(STR_FORMAT_INTEGER); - ft.Add(tileElement->base_height); + ft.Add(tileElement->BaseHeight); DrawTextBasic(&dpi, screenCoords + ScreenCoordsXY{ BaseHeightColumnXY.x, 0 }, stringFormat, ft); // Clearance height diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 9472e1b202..28639203b6 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1243,7 +1243,7 @@ static void Sub6E1F34SmallScenery( } auto screenPos = sourceScreenPos; - uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo(std::numeric_limits::max() - 32); + uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo(std::numeric_limits::max() - 32); bool can_raise_item = false; const auto* sceneryEntry = GetSmallSceneryEntry(sceneryIndex); @@ -1472,7 +1472,7 @@ static void Sub6E1F34Wall( } auto screenPos = sourceScreenPos; - uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo(std::numeric_limits::max() - 32); + uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo(std::numeric_limits::max() - 32); auto* wallEntry = GetWallEntry(sceneryIndex); if (wallEntry != nullptr) @@ -1561,7 +1561,7 @@ static void Sub6E1F34LargeScenery( } auto screenPos = sourceScreenPos; - uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo(std::numeric_limits::max() - 32); + uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo(std::numeric_limits::max() - 32); auto* sceneryEntry = GetLargeSceneryEntry(sceneryIndex); if (sceneryEntry) diff --git a/src/openrct2/actions/LandLowerAction.cpp b/src/openrct2/actions/LandLowerAction.cpp index db5cc0e636..4c0e7c1ec0 100644 --- a/src/openrct2/actions/LandLowerAction.cpp +++ b/src/openrct2/actions/LandLowerAction.cpp @@ -101,7 +101,7 @@ GameActions::Result LandLowerAction::QueryExecute(bool isExecuting) const } withinOwnership = true; - uint8_t height = surfaceElement->base_height; + uint8_t height = surfaceElement->BaseHeight; if (surfaceElement->GetSlope() & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK) height += 2; if (surfaceElement->GetSlope() & TILE_ELEMENT_SURFACE_DIAGONAL_FLAG) @@ -110,7 +110,7 @@ GameActions::Result LandLowerAction::QueryExecute(bool isExecuting) const if (height < maxHeight) continue; - height = surfaceElement->base_height; + height = surfaceElement->BaseHeight; uint8_t currentSlope = surfaceElement->GetSlope(); uint8_t newSlope = tile_element_lower_styles[tableRow][currentSlope]; if (newSlope & SURFACE_STYLE_FLAG_RAISE_OR_LOWER_BASE_HEIGHT) diff --git a/src/openrct2/actions/LandRaiseAction.cpp b/src/openrct2/actions/LandRaiseAction.cpp index 00c4076b3f..5f78121871 100644 --- a/src/openrct2/actions/LandRaiseAction.cpp +++ b/src/openrct2/actions/LandRaiseAction.cpp @@ -102,7 +102,7 @@ GameActions::Result LandRaiseAction::QueryExecute(bool isExecuting) const } withinOwnership = true; - uint8_t height = surfaceElement->base_height; + uint8_t height = surfaceElement->BaseHeight; if (height > minHeight) continue; diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index bfbe267ac0..acd8caddb8 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -216,9 +216,9 @@ TileElement* LandSetHeightAction::CheckTreeObstructions() const { for (auto* sceneryElement : TileElementsView(_coords)) { - if (_height > sceneryElement->clearance_height) + if (_height > sceneryElement->ClearanceHeight) continue; - if (_height + 4 < sceneryElement->base_height) + if (_height + 4 < sceneryElement->BaseHeight) continue; auto* sceneryEntry = sceneryElement->GetEntry(); @@ -236,9 +236,9 @@ money32 LandSetHeightAction::GetSmallSceneryRemovalCost() const for (auto* sceneryElement : TileElementsView(_coords)) { - if (_height > sceneryElement->clearance_height) + if (_height > sceneryElement->ClearanceHeight) continue; - if (_height + 4 < sceneryElement->base_height) + if (_height + 4 < sceneryElement->BaseHeight) continue; auto* sceneryEntry = sceneryElement->GetEntry(); @@ -260,9 +260,9 @@ void LandSetHeightAction::SmallSceneryRemoval() const break; if (tileElement->GetType() != TileElementType::SmallScenery) continue; - if (_height > tileElement->clearance_height) + if (_height > tileElement->ClearanceHeight) continue; - if (_height + 4 < tileElement->base_height) + if (_height + 4 < tileElement->BaseHeight) continue; TileElementRemove(tileElement--); } while (!(tileElement++)->IsLastForTile()); @@ -288,7 +288,7 @@ StringId LandSetHeightAction::CheckRideSupports() const maxHeight = ride->GetRideTypeDescriptor().Heights.MaxHeight; } - int32_t zDelta = trackElement->clearance_height - _height; + int32_t zDelta = trackElement->ClearanceHeight - _height; if (zDelta >= 0 && zDelta / 2 > maxHeight) { return STR_SUPPORTS_CANT_BE_EXTENDED; @@ -335,8 +335,8 @@ money32 LandSetHeightAction::GetSurfaceHeightChangeCost(SurfaceElement* surfaceE void LandSetHeightAction::SetSurfaceHeight(TileElement* surfaceElement) const { - surfaceElement->base_height = _height; - surfaceElement->clearance_height = _height; + surfaceElement->BaseHeight = _height; + surfaceElement->ClearanceHeight = _height; surfaceElement->AsSurface()->SetSlope(_style); int32_t waterHeight = surfaceElement->AsSurface()->GetWaterHeight() / COORDS_Z_STEP; if (waterHeight != 0 && waterHeight <= _height) diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index 10e032c45c..69107a3637 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -174,8 +174,8 @@ GameActions::Result LandSetRightsAction::MapBuyLandRightsForTile(const CoordsXY& // There is no need to check the height if _ownership is 0 (unowned and no rights available). if (_ownership == OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED || _ownership == OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE) { - if (entranceElement->base_height - 3 > surfaceElement->base_height - || entranceElement->base_height < surfaceElement->base_height) + if (entranceElement->BaseHeight - 3 > surfaceElement->BaseHeight + || entranceElement->BaseHeight < surfaceElement->BaseHeight) { return res; } diff --git a/src/openrct2/actions/LandSmoothAction.cpp b/src/openrct2/actions/LandSmoothAction.cpp index b5cab4c5ea..e117f8d986 100644 --- a/src/openrct2/actions/LandSmoothAction.cpp +++ b/src/openrct2/actions/LandSmoothAction.cpp @@ -66,7 +66,7 @@ GameActions::Result LandSmoothAction::Execute() const GameActions::Result LandSmoothAction::SmoothLandTile( int32_t direction, bool isExecuting, const CoordsXY& loc, SurfaceElement* surfaceElement) const { - int32_t targetBaseZ = surfaceElement->base_height; + int32_t targetBaseZ = surfaceElement->BaseHeight; int32_t slope = surfaceElement->GetSlope(); if (_isLowering) { @@ -177,7 +177,7 @@ money32 LandSmoothAction::SmoothLandRowByEdge( expectedLandHeight1 += landChangePerTile; // change land of current tile - int32_t targetBaseZ = surfaceElement->base_height; + int32_t targetBaseZ = surfaceElement->BaseHeight; int32_t slope = surfaceElement->GetSlope(); int32_t oldSlope = slope; if (_isLowering) @@ -192,7 +192,7 @@ money32 LandSmoothAction::SmoothLandRowByEdge( } } if ((shouldContinue & 0x8) - && MapGetCornerHeight(surfaceElement->base_height, oldSlope, direction2) + && MapGetCornerHeight(surfaceElement->BaseHeight, oldSlope, direction2) == MapGetCornerHeight(targetBaseZ, slope, direction2)) { slope = tile_element_lower_styles[direction2][slope]; @@ -215,7 +215,7 @@ money32 LandSmoothAction::SmoothLandRowByEdge( } } if ((shouldContinue & 0x8) - && MapGetCornerHeight(surfaceElement->base_height, oldSlope, direction2) + && MapGetCornerHeight(surfaceElement->BaseHeight, oldSlope, direction2) == MapGetCornerHeight(targetBaseZ, slope, direction2)) { slope = tile_element_raise_styles[direction2][slope]; @@ -443,7 +443,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); if (surfaceElement == nullptr) break; - uint8_t newBaseZ = surfaceElement->base_height; + uint8_t newBaseZ = surfaceElement->BaseHeight; uint8_t newSlope = surfaceElement->GetSlope(); if (raiseLand) @@ -539,7 +539,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ validRange.GetLeft(), validRange.GetTop() }); if (surfaceElement == nullptr) break; - uint8_t newBaseZ = surfaceElement->base_height; + uint8_t newBaseZ = surfaceElement->BaseHeight; uint8_t oldSlope = surfaceElement->GetSlope(); int32_t rowIndex = selectionType - (MAP_SELECT_TYPE_EDGE_0 - MAP_SELECT_TYPE_FULL - 1); uint8_t newSlope = raiseLand ? tile_element_raise_styles[rowIndex][oldSlope] diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.cpp b/src/openrct2/actions/SmallSceneryPlaceAction.cpp index f1691c5a29..88470d3a23 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.cpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.cpp @@ -145,7 +145,7 @@ GameActions::Result SmallSceneryPlaceAction::Query() const // If on water if (waterHeight > 0) { - // base_height2 is now the water height + // BaseHeight2 is now the water height surfaceHeight = waterHeight; if (_loc.z == 0) { @@ -339,7 +339,7 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const // If on water if (waterHeight > 0) { - // base_height2 is now the water height + // BaseHeight2 is now the water height surfaceHeight = waterHeight; } auto targetHeight = _loc.z; diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index 92e5e5074e..8eb868e457 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -226,7 +226,7 @@ GameActions::Result TrackRemoveAction::Query() const return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } - int8_t _support_height = tileElement->base_height - surfaceElement->base_height; + int8_t _support_height = tileElement->BaseHeight - surfaceElement->BaseHeight; if (_support_height < 0) { _support_height = 10; @@ -410,7 +410,7 @@ GameActions::Result TrackRemoveAction::Execute() const return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } - int8_t _support_height = tileElement->base_height - surfaceElement->base_height; + int8_t _support_height = tileElement->BaseHeight - surfaceElement->BaseHeight; if (_support_height < 0) { _support_height = 10; diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 36a301c2ff..a036f401a1 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -152,7 +152,7 @@ GameActions::Result WallPlaceAction::Query() const if (!(edgeSlope & (EDGE_SLOPE_UPWARDS | EDGE_SLOPE_DOWNWARDS))) { uint8_t newEdge = (_edge + 2) & 3; - uint8_t newBaseHeight = surfaceElement->base_height; + uint8_t newBaseHeight = surfaceElement->BaseHeight; newBaseHeight += 2; if (surfaceElement->GetSlope() & (1 << newEdge)) { @@ -363,7 +363,7 @@ GameActions::Result WallPlaceAction::Execute() const GameActions::Status::NoFreeElements, STR_CANT_POSITION_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); } - wallElement->clearance_height = clearanceHeight; + wallElement->ClearanceHeight = clearanceHeight; wallElement->SetDirection(_edge); wallElement->SetSlope(edgeSlope); @@ -449,7 +449,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( { const rct_preview_track* trackBlock = ted.GetBlockForSequence(sequence); z = ted.Coordinates.z_begin; - z = trackElement->base_height + ((z - trackBlock->z) * 8); + z = trackElement->BaseHeight + ((z - trackBlock->z) * 8); if (z == z0) { return true; @@ -484,7 +484,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( trackBlock = ted.GetBlockForSequence(sequence); z = ted.Coordinates.z_end; - z = trackElement->base_height + ((z - trackBlock->z) * 8); + z = trackElement->BaseHeight + ((z - trackBlock->z) * 8); return z == z0; } @@ -511,9 +511,9 @@ GameActions::Result WallPlaceAction::WallCheckObstruction( continue; if (tileElement->IsGhost()) continue; - if (z0 >= tileElement->clearance_height) + if (z0 >= tileElement->ClearanceHeight) continue; - if (z1 <= tileElement->base_height) + if (z1 <= tileElement->BaseHeight) continue; if (elementType == TileElementType::Wall) { diff --git a/src/openrct2/actions/WaterRaiseAction.cpp b/src/openrct2/actions/WaterRaiseAction.cpp index 77b3f0657e..a94e716664 100644 --- a/src/openrct2/actions/WaterRaiseAction.cpp +++ b/src/openrct2/actions/WaterRaiseAction.cpp @@ -87,7 +87,7 @@ GameActions::Result WaterRaiseAction::QueryExecute(bool isExecuting) const uint8_t height = surfaceElement->GetWaterHeight() / COORDS_Z_STEP; - if (surfaceElement->base_height > maxHeight) + if (surfaceElement->BaseHeight > maxHeight) continue; if (height != 0) @@ -98,7 +98,7 @@ GameActions::Result WaterRaiseAction::QueryExecute(bool isExecuting) const } else { - height = surfaceElement->base_height + 2; + height = surfaceElement->BaseHeight + 2; } auto waterSetHeightAction = WaterSetHeightAction({ x, y }, height); waterSetHeightAction.SetFlags(GetFlags()); diff --git a/src/openrct2/actions/WaterSetHeightAction.cpp b/src/openrct2/actions/WaterSetHeightAction.cpp index 29ff1745a7..31ac689261 100644 --- a/src/openrct2/actions/WaterSetHeightAction.cpp +++ b/src/openrct2/actions/WaterSetHeightAction.cpp @@ -122,7 +122,7 @@ GameActions::Result WaterSetHeightAction::Execute() const return GameActions::Result(GameActions::Status::Unknown, STR_NONE, STR_NONE); } - if (_height > surfaceElement->base_height) + if (_height > surfaceElement->BaseHeight) { surfaceElement->SetWaterHeight(_height * COORDS_Z_STEP); } diff --git a/src/openrct2/core/DataSerialiserTraits.h b/src/openrct2/core/DataSerialiserTraits.h index 20e8f6869b..83ff87a99b 100644 --- a/src/openrct2/core/DataSerialiserTraits.h +++ b/src/openrct2/core/DataSerialiserTraits.h @@ -452,9 +452,9 @@ template<> struct DataSerializerTraitsT { stream->WriteValue(tileElement.type); stream->WriteValue(tileElement.Flags); - stream->WriteValue(tileElement.base_height); - stream->WriteValue(tileElement.clearance_height); - stream->WriteValue(tileElement.owner); + stream->WriteValue(tileElement.BaseHeight); + stream->WriteValue(tileElement.ClearanceHeight); + stream->WriteValue(tileElement.Owner); for (auto v : tileElement.pad_05) { stream->WriteValue(v); @@ -468,9 +468,9 @@ template<> struct DataSerializerTraitsT { tileElement.type = stream->ReadValue(); tileElement.Flags = stream->ReadValue(); - tileElement.base_height = stream->ReadValue(); - tileElement.clearance_height = stream->ReadValue(); - tileElement.owner = stream->ReadValue(); + tileElement.BaseHeight = stream->ReadValue(); + tileElement.ClearanceHeight = stream->ReadValue(); + tileElement.Owner = stream->ReadValue(); for (auto& v : tileElement.pad_05) { v = stream->ReadValue(); @@ -484,8 +484,8 @@ template<> struct DataSerializerTraitsT { char msg[128] = {}; snprintf( - msg, sizeof(msg), "TileElement(type = %u, flags = %u, base_height = %u)", tileElement.type, tileElement.Flags, - tileElement.base_height); + msg, sizeof(msg), "TileElement(type = %u, flags = %u, BaseHeight = %u)", tileElement.type, tileElement.Flags, + tileElement.BaseHeight); stream->Write(msg, strlen(msg)); } }; diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 566e4a47d4..dc40253e4e 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -1913,7 +1913,7 @@ static bool PeepInteractWithEntrance(Peep* peep, const CoordsXYE& coords, uint8_ uint8_t slopeDirection = nextTileElement->AsPath()->GetSlopeDirection(); if (slopeDirection == entranceDirection) { - if (z != nextTileElement->base_height) + if (z != nextTileElement->BaseHeight) { continue; } @@ -1924,13 +1924,13 @@ static bool PeepInteractWithEntrance(Peep* peep, const CoordsXYE& coords, uint8_ if (DirectionReverse(slopeDirection) != entranceDirection) continue; - if (z - 2 != nextTileElement->base_height) + if (z - 2 != nextTileElement->BaseHeight) continue; found = true; break; } - if (z != nextTileElement->base_height) + if (z != nextTileElement->BaseHeight) { continue; } @@ -2439,9 +2439,9 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result) do { - if (base_z > tileElement->base_height) + if (base_z > tileElement->BaseHeight) continue; - if (top_z < tileElement->base_height) + if (top_z < tileElement->BaseHeight) continue; if (tileElement->IsGhost()) continue; diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index 179e49bebe..ecfe3f5f5b 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -365,7 +365,7 @@ Direction Staff::HandymanDirectionToNearestLitter() const return INVALID_DIRECTION; do { - if (tileElement->base_height != nextZ) + if (tileElement->BaseHeight != nextZ) continue; if (tileElement->GetType() == TileElementType::Entrance || tileElement->GetType() == TileElementType::Track) { @@ -381,7 +381,7 @@ Direction Staff::HandymanDirectionToNearestLitter() const do { - if (tileElement->base_height != nextZ) + if (tileElement->BaseHeight != nextZ) continue; if (tileElement->GetType() == TileElementType::Entrance || tileElement->GetType() == TileElementType::Track) { @@ -1374,7 +1374,7 @@ void Staff::UpdateHeadingToInspect() SetDestination(newDestination, 2); sprite_direction = PeepDirection << 3; - z = rideEntranceExitElement->base_height * 4; + z = rideEntranceExitElement->BaseHeight * 4; SubState = 4; // Falls through into SubState 4 } @@ -1484,7 +1484,7 @@ void Staff::UpdateAnswering() SetDestination({ destX, destY }, 2); sprite_direction = PeepDirection << 3; - z = rideEntranceExitElement->base_height * 4; + z = rideEntranceExitElement->BaseHeight * 4; SubState = 4; // Falls through into SubState 4 } diff --git a/src/openrct2/paint/tile_element/Paint.Wall.cpp b/src/openrct2/paint/tile_element/Paint.Wall.cpp index fbc801231d..4fa99de7c1 100644 --- a/src/openrct2/paint/tile_element/Paint.Wall.cpp +++ b/src/openrct2/paint/tile_element/Paint.Wall.cpp @@ -323,7 +323,7 @@ void PaintWall(PaintSession& session, uint8_t direction, int32_t height, const W imageTemplate = imageTemplate.WithTertiary(wallElement.GetTertiaryColour()); } - PaintUtilSetGeneralSupportHeight(session, 8 * wallElement.clearance_height, 0x20); + PaintUtilSetGeneralSupportHeight(session, 8 * wallElement.ClearanceHeight, 0x20); auto isGhost = false; if (gTrackDesignSaveMode || (session.ViewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index 95c1f04b01..c5296c962b 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -344,7 +344,7 @@ static uint8_t FootpathElementDestInDir(TileCoordsXYZ loc, Direction chosenDirec { case TileElementType::Track: { - if (loc.z != tileElement->base_height) + if (loc.z != tileElement->BaseHeight) continue; RideId rideIndex = tileElement->AsTrack()->GetRideIndex(); auto ride = GetRide(rideIndex); @@ -356,7 +356,7 @@ static uint8_t FootpathElementDestInDir(TileCoordsXYZ loc, Direction chosenDirec } break; case TileElementType::Entrance: - if (loc.z != tileElement->base_height) + if (loc.z != tileElement->BaseHeight) continue; switch (tileElement->AsEntrance()->GetEntranceType()) { @@ -389,7 +389,7 @@ static uint8_t FootpathElementDestInDir(TileCoordsXYZ loc, Direction chosenDirec uint8_t edges = PathGetPermittedEdges(tileElement->AsPath()); edges &= ~(1 << DirectionReverse(chosenDirection)); - loc.z = tileElement->base_height; + loc.z = tileElement->BaseHeight; for (Direction dir : ALL_DIRECTIONS) { @@ -760,7 +760,7 @@ static void PeepPathfindHeuristicSearch( { case TileElementType::Track: { - if (loc.z != tileElement->base_height) + if (loc.z != tileElement->BaseHeight) continue; /* For peeps heading for a shop, the goal is the shop * tile. */ @@ -774,7 +774,7 @@ static void PeepPathfindHeuristicSearch( break; } case TileElementType::Entrance: - if (loc.z != tileElement->base_height) + if (loc.z != tileElement->BaseHeight) continue; Direction direction; searchResult = PATH_SEARCH_OTHER; @@ -828,7 +828,7 @@ static void PeepPathfindHeuristicSearch( continue; // Path may be sloped, so set z to path base height. - loc.z = tileElement->base_height; + loc.z = tileElement->BaseHeight; if (tileElement->AsPath()->IsWide()) { @@ -1311,7 +1311,7 @@ Direction OriginalPathfinding::ChooseDirection(const TileCoordsXYZ& loc, Peep& p { if (dest_tile_element == nullptr) break; - if (dest_tile_element->base_height != loc.z) + if (dest_tile_element->BaseHeight != loc.z) continue; if (dest_tile_element->GetType() != TileElementType::Path) continue; @@ -1810,7 +1810,7 @@ static void GetRideQueueEnd(TileCoordsXYZ& loc) if (tileElement->GetType() != TileElementType::Entrance) continue; - if (loc.z != tileElement->base_height) + if (loc.z != tileElement->BaseHeight) continue; found = true; @@ -1824,7 +1824,7 @@ static void GetRideQueueEnd(TileCoordsXYZ& loc) TileElement* lastPathElement = nullptr; TileElement* firstPathElement = nullptr; - int16_t baseZ = tileElement->base_height; + int16_t baseZ = tileElement->BaseHeight; TileCoordsXY nextTile = { loc.x, loc.y }; while (true) @@ -1857,7 +1857,7 @@ static void GetRideQueueEnd(TileCoordsXYZ& loc) if (tileElement->GetType() != TileElementType::Path) continue; - if (baseZ == tileElement->base_height) + if (baseZ == tileElement->BaseHeight) { if (tileElement->AsPath()->IsSloped()) { @@ -1870,7 +1870,7 @@ static void GetRideQueueEnd(TileCoordsXYZ& loc) break; } - if (baseZ - 2 == tileElement->base_height) + if (baseZ - 2 == tileElement->BaseHeight) { if (!tileElement->AsPath()->IsSloped()) break; @@ -1926,7 +1926,7 @@ static void GetRideQueueEnd(TileCoordsXYZ& loc) loc.x = queueEnd.x; loc.y = queueEnd.y; - loc.z = tileElement->base_height; + loc.z = tileElement->BaseHeight; } /* @@ -2275,7 +2275,7 @@ bool GuestPathfinding::IsValidPathZAndDirection(TileElement* tileElement, int32_ int32_t slopeDirection = tileElement->AsPath()->GetSlopeDirection(); if (slopeDirection == currentDirection) { - if (currentZ != tileElement->base_height) + if (currentZ != tileElement->BaseHeight) return false; } else @@ -2283,13 +2283,13 @@ bool GuestPathfinding::IsValidPathZAndDirection(TileElement* tileElement, int32_ slopeDirection = DirectionReverse(slopeDirection); if (slopeDirection != currentDirection) return false; - if (currentZ != tileElement->base_height + 2) + if (currentZ != tileElement->BaseHeight + 2) return false; } } else { - if (currentZ != tileElement->base_height) + if (currentZ != tileElement->BaseHeight) return false; } return true; diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 10afcbbc83..d8ade35abe 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1522,7 +1522,7 @@ namespace RCT1 RCT12TileElement* srcElement = tilePointerIndex.GetFirstElementAt(coords); do { - if (srcElement->base_height == Limits::MaxElementHeight) + if (srcElement->BaseHeight == Limits::MaxElementHeight) continue; // Reserve 8 elements for import @@ -1568,8 +1568,8 @@ namespace RCT1 // This flag will be set by the caller. dst->SetLastForTile(false); - dst->SetBaseZ(src->base_height * Limits::CoordsZStep); - dst->SetClearanceZ(src->clearance_height * Limits::CoordsZStep); + dst->SetBaseZ(src->BaseHeight * Limits::CoordsZStep); + dst->SetClearanceZ(src->ClearanceHeight * Limits::CoordsZStep); switch (tileElementType) { @@ -1776,8 +1776,8 @@ namespace RCT1 ConvertWall(type, &colourA, &colourB); type = _wallTypeToEntryMap[type]; - auto baseZ = src->base_height * Limits::CoordsZStep; - auto clearanceZ = src->clearance_height * Limits::CoordsZStep; + auto baseZ = src->BaseHeight * Limits::CoordsZStep; + auto clearanceZ = src->ClearanceHeight * Limits::CoordsZStep; auto edgeSlope = LandSlopeToWallSlope[slope][edge & 3]; if (edgeSlope & (EDGE_SLOPE_UPWARDS | EDGE_SLOPE_DOWNWARDS)) { diff --git a/src/openrct2/rct12/RCT12.h b/src/openrct2/rct12/RCT12.h index cc8eaf817d..2748fdeec3 100644 --- a/src/openrct2/rct12/RCT12.h +++ b/src/openrct2/rct12/RCT12.h @@ -310,10 +310,10 @@ struct RCT12EightCarsCorruptElement15; struct RCT12TileElementBase { - uint8_t type; // 0 - uint8_t flags; // 1. Upper nibble: flags. Lower nibble: occupied quadrants (one bit per quadrant). - uint8_t base_height; // 2 - uint8_t clearance_height; // 3 + uint8_t type; // 0 + uint8_t flags; // 1. Upper nibble: flags. Lower nibble: occupied quadrants (one bit per quadrant). + uint8_t BaseHeight; // 2 + uint8_t ClearanceHeight; // 3 RCT12TileElementType GetType() const; uint8_t GetDirection() const; diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index e6781911de..1e151bb211 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -748,7 +748,7 @@ namespace RCT2 uint8_t current_ride; uint8_t state; uint8_t proximity_track_type; - uint8_t proximity_base_height; + uint8_t proximity_BaseHeight; uint16_t proximity_total; uint16_t proximity_scores[26]; uint16_t num_brakes; diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 714f149e8b..d063d164e7 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1084,7 +1084,7 @@ namespace RCT2 src.proximity_track_type, _s6.rides[src.current_ride].type, IsFlatRide(src.current_ride)); else dst.ProximityTrackType = 0xFF; - dst.ProximityBaseHeight = src.proximity_base_height; + dst.ProximityBaseHeight = src.proximity_BaseHeight; dst.ProximityTotal = src.proximity_total; for (size_t i = 0; i < std::size(src.proximity_scores); i++) { @@ -1276,7 +1276,7 @@ namespace RCT2 { do { - if (srcElement->base_height == RCT12::Limits::MaxElementHeight) + if (srcElement->BaseHeight == RCT12::Limits::MaxElementHeight) { continue; } @@ -1329,8 +1329,8 @@ namespace RCT2 const auto rct12Type = src->GetType(); dst->ClearAs(ToOpenRCT2TileElementType(rct12Type)); dst->SetDirection(src->GetDirection()); - dst->SetBaseZ(src->base_height * COORDS_Z_STEP); - dst->SetClearanceZ(src->clearance_height * COORDS_Z_STEP); + dst->SetBaseZ(src->BaseHeight * COORDS_Z_STEP); + dst->SetClearanceZ(src->ClearanceHeight * COORDS_Z_STEP); // All saved in "flags" dst->SetOccupiedQuadrants(src->GetOccupiedQuadrants()); diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 454fbb0485..d0cc51e092 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -2339,7 +2339,7 @@ static void ride_shop_connected(const Ride& ride) int32_t y2 = shopLoc.y - TileDirectionDelta[face_direction].y; int32_t x2 = shopLoc.x - TileDirectionDelta[face_direction].x; - if (MapCoordIsConnected({ x2, y2, tileElement->base_height }, face_direction)) + if (MapCoordIsConnected({ x2, y2, tileElement->BaseHeight }, face_direction)) return; } @@ -5474,18 +5474,18 @@ void DetermineRideEntranceAndExitLocations() { if (station.Entrance.z == expectedHeight) continue; - if (station.Entrance.z > entranceElement->base_height) + if (station.Entrance.z > entranceElement->BaseHeight) continue; } // Found our entrance - station.Entrance = { x, y, entranceElement->base_height, + station.Entrance = { x, y, entranceElement->BaseHeight, static_cast(entranceElement->GetDirection()) }; alreadyFoundEntrance = true; LOG_VERBOSE( "Fixed disconnected entrance of ride %d, station %d to x = %d, y = %d and z = %d.", ride.id, - stationIndex, x, y, entranceElement->base_height); + stationIndex, x, y, entranceElement->BaseHeight); } else if (fixExit && entranceElement->GetEntranceType() == ENTRANCE_TYPE_RIDE_EXIT) { @@ -5493,18 +5493,18 @@ void DetermineRideEntranceAndExitLocations() { if (station.Exit.z == expectedHeight) continue; - if (station.Exit.z > entranceElement->base_height) + if (station.Exit.z > entranceElement->BaseHeight) continue; } // Found our exit - station.Exit = { x, y, entranceElement->base_height, + station.Exit = { x, y, entranceElement->BaseHeight, static_cast(entranceElement->GetDirection()) }; alreadyFoundExit = true; LOG_VERBOSE( "Fixed disconnected exit of ride %d, station %d to x = %d, y = %d and z = %d.", ride.id, - stationIndex, x, y, entranceElement->base_height); + stationIndex, x, y, entranceElement->BaseHeight); } } while (!(tileElement++)->IsLastForTile()); } diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index f682a36e48..af570faeef 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -352,8 +352,7 @@ void RideClearBlockedTiles(const Ride& ride) continue; // Unblock footpath element that is at same position - auto* footpathElement = MapGetFootpathElement( - TileCoordsXYZ{ tilePos, trackElement->base_height }.ToCoordsXYZ()); + auto* footpathElement = MapGetFootpathElement(TileCoordsXYZ{ tilePos, trackElement->BaseHeight }.ToCoordsXYZ()); if (footpathElement == nullptr) continue; @@ -1498,7 +1497,7 @@ void Ride::ValidateStations() { if (tileElement->GetType() != TileElementType::Entrance) continue; - if (tileElement->base_height != locationCoords.z) + if (tileElement->BaseHeight != locationCoords.z) continue; if (tileElement->AsEntrance()->GetRideIndex() != id) continue; @@ -1522,7 +1521,7 @@ void Ride::ValidateStations() continue; if (trackElement->AsTrack()->GetRideIndex() != id) continue; - if (trackElement->base_height != tileElement->base_height) + if (trackElement->BaseHeight != tileElement->BaseHeight) continue; auto trackType = trackElement->AsTrack()->GetTrackType(); diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 79124a7ea9..8f0fecc800 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -453,9 +453,9 @@ static void ride_ratings_score_close_proximity_in_direction( switch (tileElement->GetType()) { case TileElementType::Surface: - if (state.ProximityBaseHeight <= inputTileElement->base_height) + if (state.ProximityBaseHeight <= inputTileElement->BaseHeight) { - if (inputTileElement->clearance_height <= tileElement->base_height) + if (inputTileElement->ClearanceHeight <= tileElement->BaseHeight) { proximity_score_increment(state, PROXIMITY_SURFACE_SIDE_CLOSE); } @@ -509,8 +509,8 @@ static void ride_ratings_score_close_proximity_loops_helper(RideRatingUpdateStat auto type = tileElement->GetType(); if (type == TileElementType::Path) { - int32_t zDiff = static_cast(tileElement->base_height) - - static_cast(coordsElement.element->base_height); + int32_t zDiff = static_cast(tileElement->BaseHeight) + - static_cast(coordsElement.element->BaseHeight); if (zDiff >= 0 && zDiff <= 16) { proximity_score_increment(state, PROXIMITY_PATH_TROUGH_VERTICAL_LOOP); @@ -521,8 +521,8 @@ static void ride_ratings_score_close_proximity_loops_helper(RideRatingUpdateStat bool elementsAreAt90DegAngle = ((tileElement->GetDirection() ^ coordsElement.element->GetDirection()) & 1) != 0; if (elementsAreAt90DegAngle) { - int32_t zDiff = static_cast(tileElement->base_height) - - static_cast(coordsElement.element->base_height); + int32_t zDiff = static_cast(tileElement->BaseHeight) + - static_cast(coordsElement.element->BaseHeight); if (zDiff >= 0 && zDiff <= 16) { proximity_score_increment(state, PROXIMITY_TRACK_THROUGH_VERTICAL_LOOP); @@ -578,7 +578,7 @@ static void ride_ratings_score_close_proximity(RideRatingUpdateState& state, Til switch (tileElement->GetType()) { case TileElementType::Surface: - state.ProximityBaseHeight = tileElement->base_height; + state.ProximityBaseHeight = tileElement->BaseHeight; if (tileElement->GetBaseZ() == state.Proximity.z) { proximity_score_increment(state, PROXIMITY_SURFACE_TOUCH); @@ -643,7 +643,7 @@ static void ride_ratings_score_close_proximity(RideRatingUpdateState& state, Til int32_t sequence = tileElement->AsTrack()->GetSequenceIndex(); if (sequence == 3 || sequence == 6) { - if (tileElement->base_height - inputTileElement->clearance_height <= 10) + if (tileElement->BaseHeight - inputTileElement->ClearanceHeight <= 10) { proximity_score_increment(state, PROXIMITY_THROUGH_VERTICAL_LOOP); } @@ -656,20 +656,20 @@ static void ride_ratings_score_close_proximity(RideRatingUpdateState& state, Til { proximity_score_increment(state, PROXIMITY_FOREIGN_TRACK_TOUCH_ABOVE); } - if (tileElement->clearance_height + 2 <= inputTileElement->base_height) + if (tileElement->ClearanceHeight + 2 <= inputTileElement->BaseHeight) { - if (tileElement->clearance_height + 10 >= inputTileElement->base_height) + if (tileElement->ClearanceHeight + 10 >= inputTileElement->BaseHeight) { proximity_score_increment(state, PROXIMITY_FOREIGN_TRACK_CLOSE_ABOVE); } } - if (inputTileElement->clearance_height == tileElement->base_height) + if (inputTileElement->ClearanceHeight == tileElement->BaseHeight) { proximity_score_increment(state, PROXIMITY_FOREIGN_TRACK_TOUCH_ABOVE); } - if (inputTileElement->clearance_height + 2 == tileElement->base_height) + if (inputTileElement->ClearanceHeight + 2 == tileElement->BaseHeight) { - if (static_cast(inputTileElement->clearance_height + 10) >= tileElement->base_height) + if (static_cast(inputTileElement->ClearanceHeight + 10) >= tileElement->BaseHeight) { proximity_score_increment(state, PROXIMITY_FOREIGN_TRACK_CLOSE_ABOVE); } @@ -678,7 +678,7 @@ static void ride_ratings_score_close_proximity(RideRatingUpdateState& state, Til else { bool isStation = tileElement->AsTrack()->IsStation(); - if (tileElement->clearance_height == inputTileElement->base_height) + if (tileElement->ClearanceHeight == inputTileElement->BaseHeight) { proximity_score_increment(state, PROXIMITY_OWN_TRACK_TOUCH_ABOVE); if (isStation) @@ -686,9 +686,9 @@ static void ride_ratings_score_close_proximity(RideRatingUpdateState& state, Til proximity_score_increment(state, PROXIMITY_OWN_STATION_TOUCH_ABOVE); } } - if (tileElement->clearance_height + 2 <= inputTileElement->base_height) + if (tileElement->ClearanceHeight + 2 <= inputTileElement->BaseHeight) { - if (tileElement->clearance_height + 10 >= inputTileElement->base_height) + if (tileElement->ClearanceHeight + 10 >= inputTileElement->BaseHeight) { proximity_score_increment(state, PROXIMITY_OWN_TRACK_CLOSE_ABOVE); if (isStation) @@ -706,9 +706,9 @@ static void ride_ratings_score_close_proximity(RideRatingUpdateState& state, Til proximity_score_increment(state, PROXIMITY_OWN_STATION_TOUCH_ABOVE); } } - if (inputTileElement->clearance_height + 2 <= tileElement->base_height) + if (inputTileElement->ClearanceHeight + 2 <= tileElement->BaseHeight) { - if (inputTileElement->clearance_height + 10 >= tileElement->base_height) + if (inputTileElement->ClearanceHeight + 10 >= tileElement->BaseHeight) { proximity_score_increment(state, PROXIMITY_OWN_TRACK_CLOSE_ABOVE); if (isStation) diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 5ce887b0c9..a66d17d160 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -1762,7 +1762,7 @@ static GameActions::Result TrackDesignPlaceRide(TrackDesignState& tds, TrackDesi { continue; } - if (tile_element->base_height != newCoords.z) + if (tile_element->BaseHeight != newCoords.z) { continue; } diff --git a/src/openrct2/ride/TrackDesignSave.cpp b/src/openrct2/ride/TrackDesignSave.cpp index 3bc870d97c..b2373de11b 100644 --- a/src/openrct2/ride/TrackDesignSave.cpp +++ b/src/openrct2/ride/TrackDesignSave.cpp @@ -272,7 +272,7 @@ static TrackDesignAddStatus track_design_save_add_large_scenery(const CoordsXY& auto sceneryEntry = reinterpret_cast(obj->GetLegacyData()); auto sceneryTiles = sceneryEntry->tiles; - int32_t z = tileElement->base_height; + int32_t z = tileElement->BaseHeight; auto direction = tileElement->GetDirection(); auto sequence = tileElement->GetSequenceIndex(); @@ -489,7 +489,7 @@ static void track_design_save_remove_large_scenery(const CoordsXY& loc, LargeSce auto sceneryEntry = reinterpret_cast(obj->GetLegacyData()); auto sceneryTiles = sceneryEntry->tiles; - int32_t z = tileElement->base_height; + int32_t z = tileElement->BaseHeight; auto direction = tileElement->GetDirection(); auto sequence = tileElement->GetSequenceIndex(); diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 2970fda025..63380c4b57 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -9232,7 +9232,7 @@ void Vehicle::UpdateCrossings() const break; } - curZ = xyElement.element->base_height; + curZ = xyElement.element->BaseHeight; if (travellingForwards) { diff --git a/src/openrct2/ride/gentle/MiniGolf.cpp b/src/openrct2/ride/gentle/MiniGolf.cpp index 2cc9887bea..451dab5733 100644 --- a/src/openrct2/ride/gentle/MiniGolf.cpp +++ b/src/openrct2/ride/gentle/MiniGolf.cpp @@ -453,7 +453,7 @@ static bool MiniGolfPaintUtilShouldDrawFence(PaintSession& session, const TrackE } const TileElement* surfaceElement = session.SurfaceElement; - if (surfaceElement->base_height != trackElement.base_height) + if (surfaceElement->BaseHeight != trackElement.BaseHeight) { return true; } diff --git a/src/openrct2/ride/transport/Chairlift.cpp b/src/openrct2/ride/transport/Chairlift.cpp index 73c5d5aadd..5ecba6beca 100644 --- a/src/openrct2/ride/transport/Chairlift.cpp +++ b/src/openrct2/ride/transport/Chairlift.cpp @@ -128,7 +128,7 @@ static const TrackElement* ChairliftPaintUtilMapGetTrackElementAtFromRideFuzzy( continue; if (tileElement->GetRideIndex() != ride.id) continue; - if (tileElement->base_height != z && tileElement->base_height != z - 1) + if (tileElement->BaseHeight != z && tileElement->BaseHeight != z - 1) continue; return tileElement->AsTrack(); @@ -152,7 +152,7 @@ static bool ChairliftPaintUtilIsFirstTrack( }; const TrackElement* nextTrack = ChairliftPaintUtilMapGetTrackElementAtFromRideFuzzy( - newPos.x, newPos.y, trackElement.base_height, ride); + newPos.x, newPos.y, trackElement.BaseHeight, ride); return nextTrack == nullptr; } @@ -172,7 +172,7 @@ static bool ChairliftPaintUtilIsLastTrack( }; const TrackElement* nextTrack = ChairliftPaintUtilMapGetTrackElementAtFromRideFuzzy( - newPos.x, newPos.y, trackElement.base_height, ride); + newPos.x, newPos.y, trackElement.BaseHeight, ride); return nextTrack == nullptr; } diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.cpp b/src/openrct2/scripting/bindings/world/ScTileElement.cpp index 37948cf249..44fea35ab7 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.cpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.cpp @@ -91,12 +91,12 @@ namespace OpenRCT2::Scripting uint8_t ScTileElement::baseHeight_get() const { - return _element->base_height; + return _element->BaseHeight; } void ScTileElement::baseHeight_set(uint8_t newBaseHeight) { ThrowIfGameStateNotMutable(); - _element->base_height = newBaseHeight; + _element->BaseHeight = newBaseHeight; Invalidate(); } @@ -113,12 +113,12 @@ namespace OpenRCT2::Scripting uint8_t ScTileElement::clearanceHeight_get() const { - return _element->clearance_height; + return _element->ClearanceHeight; } void ScTileElement::clearanceHeight_set(uint8_t newClearanceHeight) { ThrowIfGameStateNotMutable(); - _element->clearance_height = newClearanceHeight; + _element->ClearanceHeight = newClearanceHeight; Invalidate(); } diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index cae037a186..ab0c9355b7 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -276,7 +276,7 @@ void BannerFixDuplicates() { LOG_INFO( "Duplicated banner with index %d found at x = %d, y = %d and z = %d.", index, x, y, - bannerElement->base_height); + bannerElement->BaseHeight); // Banner index is already in use by another banner, so duplicate it auto newBanner = CreateBanner(); diff --git a/src/openrct2/world/Entrance.cpp b/src/openrct2/world/Entrance.cpp index 995e237275..29a85c938e 100644 --- a/src/openrct2/world/Entrance.cpp +++ b/src/openrct2/world/Entrance.cpp @@ -229,7 +229,7 @@ void ParkEntranceUpdateLocations() if (entranceElement != nullptr && entranceElement->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE && entranceElement->GetSequenceIndex() == 0 && !entranceElement->IsGhost()) { - auto entrance = TileCoordsXYZD(it.x, it.y, it.element->base_height, it.element->GetDirection()).ToCoordsXYZD(); + auto entrance = TileCoordsXYZD(it.x, it.y, it.element->BaseHeight, it.element->GetDirection()).ToCoordsXYZD(); gParkEntrances.push_back(entrance); } } diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 1951d27dc2..94c63dc7c3 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -1254,7 +1254,7 @@ static void FootpathFixOwnership(const CoordsXY& mapPos) if (surfaceElement != nullptr) { // If the tile is not safe to own construction rights of, erase them. - if (CheckMaxAllowableLandRightsForTile({ mapPos, surfaceElement->base_height << 3 }) == OWNERSHIP_UNOWNED) + if (CheckMaxAllowableLandRightsForTile({ mapPos, surfaceElement->BaseHeight << 3 }) == OWNERSHIP_UNOWNED) { ownership = OWNERSHIP_UNOWNED; } @@ -2161,7 +2161,7 @@ bool TileElementWantsPathConnectionTowards(const TileCoordsXYZD& coords, const T switch (tileElement->GetType()) { case TileElementType::Path: - if (tileElement->base_height == coords.z) + if (tileElement->BaseHeight == coords.z) { if (!tileElement->AsPath()->IsSloped()) // The footpath is flat, it can be connected to from any direction @@ -2170,7 +2170,7 @@ bool TileElementWantsPathConnectionTowards(const TileCoordsXYZD& coords, const T // The footpath is sloped and its lowest point matches the edge connection return true; } - else if (tileElement->base_height + 2 == coords.z) + else if (tileElement->BaseHeight + 2 == coords.z) { if (tileElement->AsPath()->IsSloped() && tileElement->AsPath()->GetSlopeDirection() == coords.direction) // The footpath is sloped and its higher point matches the edge connection @@ -2178,7 +2178,7 @@ bool TileElementWantsPathConnectionTowards(const TileCoordsXYZD& coords, const T } break; case TileElementType::Track: - if (tileElement->base_height == coords.z) + if (tileElement->BaseHeight == coords.z) { auto ride = GetRide(tileElement->AsTrack()->GetRideIndex()); if (ride == nullptr) @@ -2202,7 +2202,7 @@ bool TileElementWantsPathConnectionTowards(const TileCoordsXYZD& coords, const T } break; case TileElementType::Entrance: - if (tileElement->base_height == coords.z) + if (tileElement->BaseHeight == coords.z) { if (entrance_has_direction(*(tileElement->AsEntrance()), coords.direction - tileElement->GetDirection())) { @@ -2251,7 +2251,7 @@ static void FootpathFixCornersAround(const TileCoordsXY& footpathPos, TileElemen continue; if (tileElement->AsPath()->IsSloped()) continue; - if (tileElement->base_height != pathElement->base_height) + if (tileElement->BaseHeight != pathElement->BaseHeight) continue; const int32_t ix = xOffset + 1; @@ -2286,7 +2286,7 @@ void FootpathRemoveEdgesAt(const CoordsXY& footpathPos, TileElement* tileElement bool fixCorners = false; for (uint8_t direction = 0; direction < NumOrthogonalDirections; direction++) { - int32_t z1 = tileElement->base_height; + int32_t z1 = tileElement->BaseHeight; if (tileElement->GetType() == TileElementType::Path) { if (tileElement->AsPath()->IsSloped()) diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 7b52447dcb..c3d7694823 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -151,8 +151,8 @@ static TileElement GetDefaultSurfaceElement() TileElement el; el.ClearAs(TileElementType::Surface); el.SetLastForTile(true); - el.base_height = 14; - el.clearance_height = 14; + el.BaseHeight = 14; + el.ClearanceHeight = 14; el.AsSurface()->SetWaterHeight(0); el.AsSurface()->SetSlope(TILE_ELEMENT_SLOPE_FLAT); el.AsSurface()->SetGrassLength(GRASS_LENGTH_CLEAR_0); @@ -380,7 +380,7 @@ TileElement* MapGetFirstTileElementWithBaseHeightBetween(const TileCoordsXYRange { if (tileElement->GetType() != type) continue; - if (tileElement->base_height >= loc.baseZ && tileElement->base_height <= loc.clearanceZ) + if (tileElement->BaseHeight >= loc.baseZ && tileElement->BaseHeight <= loc.clearanceZ) return tileElement; } while (!(tileElement++)->IsLastForTile()); @@ -410,7 +410,7 @@ PathElement* MapGetPathElementAt(const TileCoordsXYZ& loc) { if (element->IsGhost()) continue; - if (element->base_height != loc.z) + if (element->BaseHeight != loc.z) continue; return element; } @@ -422,7 +422,7 @@ BannerElement* MapGetBannerElementAt(const CoordsXYZ& bannerPos, uint8_t positio const auto bannerTilePos = TileCoordsXYZ{ bannerPos }; for (auto* element : TileElementsView(bannerPos)) { - if (element->base_height != bannerTilePos.z) + if (element->BaseHeight != bannerTilePos.z) continue; if (element->GetPosition() != position) continue; @@ -693,17 +693,17 @@ bool MapCoordIsConnected(const TileCoordsXYZ& loc, uint8_t faceDirection) { if (slopeDirection == faceDirection) { - if (loc.z == tileElement->base_height + 2) + if (loc.z == tileElement->BaseHeight + 2) return true; } - else if (DirectionReverse(slopeDirection) == faceDirection && loc.z == tileElement->base_height) + else if (DirectionReverse(slopeDirection) == faceDirection && loc.z == tileElement->BaseHeight) { return true; } } else { - if (loc.z == tileElement->base_height) + if (loc.z == tileElement->BaseHeight) return true; } } while (!(tileElement++)->IsLastForTile()); @@ -992,7 +992,7 @@ int32_t MapGetCornerHeight(int32_t z, int32_t slope, int32_t direction) int32_t TileElementGetCornerHeight(const SurfaceElement* surfaceElement, int32_t direction) { - int32_t z = surfaceElement->base_height; + int32_t z = surfaceElement->BaseHeight; int32_t slope = surfaceElement->GetSlope(); return MapGetCornerHeight(z, slope, direction); } @@ -1010,7 +1010,7 @@ uint8_t MapGetLowestLandHeight(const MapRange& range) { auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ xi, yi }); - if (surfaceElement != nullptr && min_height > surfaceElement->base_height) + if (surfaceElement != nullptr && min_height > surfaceElement->BaseHeight) { if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) { @@ -1020,7 +1020,7 @@ uint8_t MapGetLowestLandHeight(const MapRange& range) } } - min_height = surfaceElement->base_height; + min_height = surfaceElement->BaseHeight; } } } @@ -1049,13 +1049,13 @@ uint8_t MapGetHighestLandHeight(const MapRange& range) } } - uint8_t base_height = surfaceElement->base_height; + uint8_t BaseHeight = surfaceElement->BaseHeight; if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) - base_height += 2; + BaseHeight += 2; if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) - base_height += 2; - if (max_height < base_height) - max_height = base_height; + BaseHeight += 2; + if (max_height < BaseHeight) + max_height = BaseHeight; } } } @@ -1086,7 +1086,7 @@ void TileElementRemove(TileElement* tileElement) // Mark the latest element with the last element flag. (tileElement - 1)->SetLastForTile(true); - tileElement->base_height = MAX_ELEMENT_HEIGHT; + tileElement->BaseHeight = MAX_ELEMENT_HEIGHT; _tileElementsInUse--; if (tileElement == &_tileElements.back()) { @@ -1252,7 +1252,7 @@ TileElement* TileElementInsert(const CoordsXYZ& loc, int32_t occupiedQuadrants, { // Copy over map element *newTileElement = *originalTileElement; - originalTileElement->base_height = MAX_ELEMENT_HEIGHT; + originalTileElement->BaseHeight = MAX_ELEMENT_HEIGHT; originalTileElement++; newTileElement++; @@ -1275,7 +1275,7 @@ TileElement* TileElementInsert(const CoordsXYZ& loc, int32_t occupiedQuadrants, newTileElement->SetLastForTile(isLastForTile); newTileElement->SetOccupiedQuadrants(occupiedQuadrants); newTileElement->SetClearanceZ(loc.z); - newTileElement->owner = 0; + newTileElement->Owner = 0; std::memset(&newTileElement->pad_05, 0, sizeof(newTileElement->pad_05)); std::memset(&newTileElement->pad_08, 0, sizeof(newTileElement->pad_08)); newTileElement++; @@ -1287,7 +1287,7 @@ TileElement* TileElementInsert(const CoordsXYZ& loc, int32_t occupiedQuadrants, { // Copy over map element *newTileElement = *originalTileElement; - originalTileElement->base_height = MAX_ELEMENT_HEIGHT; + originalTileElement->BaseHeight = MAX_ELEMENT_HEIGHT; originalTileElement++; newTileElement++; } while (!((newTileElement - 1)->IsLastForTile())); @@ -1438,7 +1438,7 @@ static void MapExtendBoundarySurfaceExtendTile(const SurfaceElement& sourceTile, destTile.SetOwnership(OWNERSHIP_UNOWNED); destTile.SetWaterHeight(sourceTile.GetWaterHeight()); - auto z = sourceTile.base_height; + auto z = sourceTile.BaseHeight; auto slope = sourceTile.GetSlope() & TILE_ELEMENT_SLOPE_NW_SIDE_UP; if (slope == TILE_ELEMENT_SLOPE_NW_SIDE_UP) { @@ -1463,8 +1463,8 @@ static void MapExtendBoundarySurfaceExtendTile(const SurfaceElement& sourceTile, slope |= TILE_ELEMENT_SLOPE_S_CORNER_UP; destTile.SetSlope(slope); - destTile.base_height = z; - destTile.clearance_height = z; + destTile.BaseHeight = z; + destTile.ClearanceHeight = z; } /** @@ -1515,9 +1515,9 @@ static void ClearElementAt(const CoordsXY& loc, TileElement** elementPtr) switch (element->GetType()) { case TileElementType::Surface: - element->base_height = MINIMUM_LAND_HEIGHT; - element->clearance_height = MINIMUM_LAND_HEIGHT; - element->owner = 0; + element->BaseHeight = MINIMUM_LAND_HEIGHT; + element->ClearanceHeight = MINIMUM_LAND_HEIGHT; + element->Owner = 0; element->AsSurface()->SetSlope(TILE_ELEMENT_SLOPE_FLAT); element->AsSurface()->SetSurfaceStyle(0); element->AsSurface()->SetEdgeStyle(0); @@ -1648,7 +1648,7 @@ LargeSceneryElement* MapGetLargeScenerySegment(const CoordsXYZD& sceneryPos, int { if (tileElement->GetType() != TileElementType::LargeScenery) continue; - if (tileElement->base_height != sceneryTilePos.z) + if (tileElement->BaseHeight != sceneryTilePos.z) continue; if (tileElement->AsLargeScenery()->GetSequenceIndex() != sequence) continue; @@ -1671,7 +1671,7 @@ EntranceElement* MapGetParkEntranceElementAt(const CoordsXYZ& entranceCoords, bo if (tileElement->GetType() != TileElementType::Entrance) continue; - if (tileElement->base_height != entranceTileCoords.z) + if (tileElement->BaseHeight != entranceTileCoords.z) continue; if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_PARK_ENTRANCE) @@ -1697,7 +1697,7 @@ EntranceElement* MapGetRideEntranceElementAt(const CoordsXYZ& entranceCoords, bo if (tileElement->GetType() != TileElementType::Entrance) continue; - if (tileElement->base_height != entranceTileCoords.z) + if (tileElement->BaseHeight != entranceTileCoords.z) continue; if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_RIDE_ENTRANCE) @@ -1723,7 +1723,7 @@ EntranceElement* MapGetRideExitElementAt(const CoordsXYZ& exitCoords, bool ghost if (tileElement->GetType() != TileElementType::Entrance) continue; - if (tileElement->base_height != exitTileCoords.z) + if (tileElement->BaseHeight != exitTileCoords.z) continue; if (tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_RIDE_EXIT) @@ -1750,7 +1750,7 @@ SmallSceneryElement* MapGetSmallSceneryElementAt(const CoordsXYZ& sceneryCoords, continue; if (tileElement->AsSmallScenery()->GetSceneryQuadrant() != quadrant) continue; - if (tileElement->base_height != sceneryTileCoords.z) + if (tileElement->BaseHeight != sceneryTileCoords.z) continue; if (tileElement->AsSmallScenery()->GetEntryIndex() != type) continue; @@ -1948,18 +1948,18 @@ bool MapSurfaceIsBlocked(const CoordsXY& mapCoords) if (surfaceElement->GetWaterHeight() > surfaceElement->GetBaseZ()) return true; - int16_t base_z = surfaceElement->base_height; - int16_t clear_z = surfaceElement->base_height + 2; + int16_t base_z = surfaceElement->BaseHeight; + int16_t clear_z = surfaceElement->BaseHeight + 2; if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) clear_z += 2; auto tileElement = reinterpret_cast(surfaceElement); while (!(tileElement++)->IsLastForTile()) { - if (clear_z >= tileElement->clearance_height) + if (clear_z >= tileElement->ClearanceHeight) continue; - if (base_z < tileElement->base_height) + if (base_z < tileElement->BaseHeight) continue; if (tileElement->GetType() == TileElementType::Path || tileElement->GetType() == TileElementType::Wall) @@ -2031,7 +2031,7 @@ TileElement* MapGetTrackElementAtOfType(const CoordsXYZ& trackPos, track_type_t { if (tileElement->GetType() != TileElementType::Track) continue; - if (tileElement->base_height != trackTilePos.z) + if (tileElement->BaseHeight != trackTilePos.z) continue; if (tileElement->AsTrack()->GetTrackType() != trackType) continue; @@ -2058,7 +2058,7 @@ TileElement* MapGetTrackElementAtOfTypeSeq(const CoordsXYZ& trackPos, track_type break; if (tileElement->GetType() != TileElementType::Track) continue; - if (tileElement->base_height != trackTilePos.z) + if (tileElement->BaseHeight != trackTilePos.z) continue; if (tileElement->AsTrack()->GetTrackType() != trackType) continue; @@ -2135,7 +2135,7 @@ TileElement* MapGetTrackElementAtOfTypeFromRide(const CoordsXYZ& trackPos, track { if (tileElement->GetType() != TileElementType::Track) continue; - if (tileElement->base_height != trackTilePos.z) + if (tileElement->BaseHeight != trackTilePos.z) continue; if (tileElement->AsTrack()->GetRideIndex() != rideIndex) continue; @@ -2164,7 +2164,7 @@ TileElement* MapGetTrackElementAtFromRide(const CoordsXYZ& trackPos, RideId ride { if (tileElement->GetType() != TileElementType::Track) continue; - if (tileElement->base_height != trackTilePos.z) + if (tileElement->BaseHeight != trackTilePos.z) continue; if (tileElement->AsTrack()->GetRideIndex() != rideIndex) continue; @@ -2192,7 +2192,7 @@ TileElement* MapGetTrackElementAtWithDirectionFromRide(const CoordsXYZD& trackPo { if (tileElement->GetType() != TileElementType::Track) continue; - if (tileElement->base_height != trackTilePos.z) + if (tileElement->BaseHeight != trackTilePos.z) continue; if (tileElement->AsTrack()->GetRideIndex() != rideIndex) continue; @@ -2234,7 +2234,7 @@ WallElement* MapGetWallElementAt(const CoordsXYZD& wallCoords) { if (tileElement->GetType() != TileElementType::Wall) continue; - if (tileElement->base_height != tileWallCoords.z) + if (tileElement->BaseHeight != tileWallCoords.z) continue; if (tileElement->GetDirection() != wallCoords.direction) continue; @@ -2265,7 +2265,7 @@ uint16_t CheckMaxAllowableLandRightsForTile(const CoordsXYZ& tileMapPos) { destOwnership = OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED; // Do not own construction rights if too high/below surface - if (tileElement->base_height - ConstructionRightsClearanceSmall > tilePos.z || tileElement->base_height < tilePos.z) + if (tileElement->BaseHeight - ConstructionRightsClearanceSmall > tilePos.z || tileElement->BaseHeight < tilePos.z) { destOwnership = OWNERSHIP_UNOWNED; break; diff --git a/src/openrct2/world/MapAnimation.cpp b/src/openrct2/world/MapAnimation.cpp index 95bd1def82..81bcbd8248 100644 --- a/src/openrct2/world/MapAnimation.cpp +++ b/src/openrct2/world/MapAnimation.cpp @@ -99,7 +99,7 @@ static bool MapAnimationInvalidateRideEntrance(const CoordsXYZ& loc) return true; do { - if (tileElement->base_height != tileLoc.z) + if (tileElement->BaseHeight != tileLoc.z) continue; if (tileElement->GetType() != TileElementType::Entrance) continue; @@ -136,7 +136,7 @@ static bool MapAnimationInvalidateQueueBanner(const CoordsXYZ& loc) return true; do { - if (tileElement->base_height != tileLoc.z) + if (tileElement->BaseHeight != tileLoc.z) continue; if (tileElement->GetType() != TileElementType::Path) continue; @@ -169,7 +169,7 @@ static bool MapAnimationInvalidateSmallScenery(const CoordsXYZ& loc) return true; do { - if (tileElement->base_height != tileLoc.z) + if (tileElement->BaseHeight != tileLoc.z) continue; if (tileElement->GetType() != TileElementType::SmallScenery) continue; @@ -234,7 +234,7 @@ static bool MapAnimationInvalidateParkEntrance(const CoordsXYZ& loc) return true; do { - if (tileElement->base_height != tileLoc.z) + if (tileElement->BaseHeight != tileLoc.z) continue; if (tileElement->GetType() != TileElementType::Entrance) continue; @@ -264,7 +264,7 @@ static bool MapAnimationInvalidateTrackWaterfall(const CoordsXYZ& loc) return true; do { - if (tileElement->base_height != tileLoc.z) + if (tileElement->BaseHeight != tileLoc.z) continue; if (tileElement->GetType() != TileElementType::Track) continue; @@ -293,7 +293,7 @@ static bool MapAnimationInvalidateTrackRapids(const CoordsXYZ& loc) return true; do { - if (tileElement->base_height != tileLoc.z) + if (tileElement->BaseHeight != tileLoc.z) continue; if (tileElement->GetType() != TileElementType::Track) continue; @@ -322,7 +322,7 @@ static bool MapAnimationInvalidateTrackOnRidePhoto(const CoordsXYZ& loc) return true; do { - if (tileElement->base_height != tileLoc.z) + if (tileElement->BaseHeight != tileLoc.z) continue; if (tileElement->GetType() != TileElementType::Track) continue; @@ -361,7 +361,7 @@ static bool MapAnimationInvalidateTrackWhirlpool(const CoordsXYZ& loc) return true; do { - if (tileElement->base_height != tileLoc.z) + if (tileElement->BaseHeight != tileLoc.z) continue; if (tileElement->GetType() != TileElementType::Track) continue; @@ -390,7 +390,7 @@ static bool MapAnimationInvalidateTrackSpinningTunnel(const CoordsXYZ& loc) return true; do { - if (tileElement->base_height != tileLoc.z) + if (tileElement->BaseHeight != tileLoc.z) continue; if (tileElement->GetType() != TileElementType::Track) continue; @@ -428,7 +428,7 @@ static bool MapAnimationInvalidateBanner(const CoordsXYZ& loc) return true; do { - if (tileElement->base_height != tileLoc.z) + if (tileElement->BaseHeight != tileLoc.z) continue; if (tileElement->GetType() != TileElementType::Banner) continue; @@ -454,7 +454,7 @@ static bool MapAnimationInvalidateLargeScenery(const CoordsXYZ& loc) return true; do { - if (tileElement->base_height != tileLoc.z) + if (tileElement->BaseHeight != tileLoc.z) continue; if (tileElement->GetType() != TileElementType::LargeScenery) continue; @@ -488,7 +488,7 @@ static bool MapAnimationInvalidateWallDoor(const CoordsXYZ& loc) return removeAnimation; do { - if (tileElement->base_height != tileLoc.z) + if (tileElement->BaseHeight != tileLoc.z) continue; if (tileElement->GetType() != TileElementType::Wall) continue; @@ -549,7 +549,7 @@ static bool MapAnimationInvalidateWall(const CoordsXYZ& loc) return true; do { - if (tileElement->base_height != tileLoc.z) + if (tileElement->BaseHeight != tileLoc.z) continue; if (tileElement->GetType() != TileElementType::Wall) continue; diff --git a/src/openrct2/world/MapGen.cpp b/src/openrct2/world/MapGen.cpp index 8f8b2bdbd2..1beb634977 100644 --- a/src/openrct2/world/MapGen.cpp +++ b/src/openrct2/world/MapGen.cpp @@ -130,8 +130,8 @@ void MapGenGenerateBlank(MapGenSettings* settings) { surfaceElement->SetSurfaceStyle(settings->floor); surfaceElement->SetEdgeStyle(settings->wall); - surfaceElement->base_height = settings->height; - surfaceElement->clearance_height = settings->height; + surfaceElement->BaseHeight = settings->height; + surfaceElement->ClearanceHeight = settings->height; } } } @@ -194,8 +194,8 @@ void MapGenGenerate(MapGenSettings* settings) { surfaceElement->SetSurfaceStyle(floorTextureId); surfaceElement->SetEdgeStyle(edgeTextureId); - surfaceElement->base_height = settings->height; - surfaceElement->clearance_height = settings->height; + surfaceElement->BaseHeight = settings->height; + surfaceElement->ClearanceHeight = settings->height; } } } @@ -241,7 +241,7 @@ void MapGenGenerate(MapGenSettings* settings) { auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); - if (surfaceElement != nullptr && surfaceElement->base_height < waterLevel + 6) + if (surfaceElement != nullptr && surfaceElement->BaseHeight < waterLevel + 6) surfaceElement->SetSurfaceStyle(beachTextureId); } } @@ -419,7 +419,7 @@ static void MapGenSetWaterLevel(int32_t waterLevel) for (int32_t x = 1; x < gMapSize.x - 1; x++) { auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); - if (surfaceElement != nullptr && surfaceElement->base_height < waterLevel) + if (surfaceElement != nullptr && surfaceElement->BaseHeight < waterLevel) surfaceElement->SetWaterHeight(waterLevel * COORDS_Z_STEP); } } @@ -482,13 +482,13 @@ static void MapGenSetHeight(MapGenSettings* settings) auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); if (surfaceElement == nullptr) continue; - surfaceElement->base_height = std::max(2, baseHeight * 2); + surfaceElement->BaseHeight = std::max(2, baseHeight * 2); // If base height is below water level, lower it to create more natural shorelines - if (surfaceElement->base_height >= 4 && surfaceElement->base_height <= settings->water_level) - surfaceElement->base_height -= 2; + if (surfaceElement->BaseHeight >= 4 && surfaceElement->BaseHeight <= settings->water_level) + surfaceElement->BaseHeight -= 2; - surfaceElement->clearance_height = surfaceElement->base_height; + surfaceElement->ClearanceHeight = surfaceElement->BaseHeight; uint8_t currentSlope = surfaceElement->GetSlope(); @@ -853,15 +853,15 @@ void MapGenGenerateFromHeightmap(MapGenSettings* settings) // Read value from bitmap, and convert its range uint8_t value = dest[x + y * _heightMapData.width]; value = static_cast(static_cast(value - minValue) / rangeIn * rangeOut) + settings->simplex_low; - surfaceElement->base_height = value; + surfaceElement->BaseHeight = value; // Floor to even number - surfaceElement->base_height /= 2; - surfaceElement->base_height *= 2; - surfaceElement->clearance_height = surfaceElement->base_height; + surfaceElement->BaseHeight /= 2; + surfaceElement->BaseHeight *= 2; + surfaceElement->ClearanceHeight = surfaceElement->BaseHeight; // Set water level - if (surfaceElement->base_height < settings->water_level) + if (surfaceElement->BaseHeight < settings->water_level) { surfaceElement->SetWaterHeight(settings->water_level * COORDS_Z_STEP); } diff --git a/src/openrct2/world/MapHelpers.cpp b/src/openrct2/world/MapHelpers.cpp index 586c7a3006..7c69eb7e73 100644 --- a/src/openrct2/world/MapHelpers.cpp +++ b/src/openrct2/world/MapHelpers.cpp @@ -17,7 +17,7 @@ static uint8_t GetBaseHeightOrZero(int32_t x, int32_t y) { auto surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }.ToCoordsXY()); - return surfaceElement != nullptr ? surfaceElement->base_height : 0; + return surfaceElement != nullptr ? surfaceElement->BaseHeight : 0; } /** @@ -37,15 +37,15 @@ int32_t MapSmooth(int32_t l, int32_t t, int32_t r, int32_t b) surfaceElement->SetSlope(TILE_ELEMENT_SLOPE_FLAT); // Raise to edge height - 2 - highest = surfaceElement->base_height; + highest = surfaceElement->BaseHeight; highest = std::max(highest, GetBaseHeightOrZero(x - 1, y + 0)); highest = std::max(highest, GetBaseHeightOrZero(x + 1, y + 0)); highest = std::max(highest, GetBaseHeightOrZero(x + 0, y - 1)); highest = std::max(highest, GetBaseHeightOrZero(x + 0, y + 1)); - if (surfaceElement->base_height < highest - 2) + if (surfaceElement->BaseHeight < highest - 2) { raisedLand = 1; - surfaceElement->base_height = surfaceElement->clearance_height = highest - 2; + surfaceElement->BaseHeight = surfaceElement->ClearanceHeight = highest - 2; } // Check corners @@ -54,11 +54,11 @@ int32_t MapSmooth(int32_t l, int32_t t, int32_t r, int32_t b) cornerHeights[1] = GetBaseHeightOrZero(x + 1, y - 1); cornerHeights[2] = GetBaseHeightOrZero(x + 1, y + 1); cornerHeights[3] = GetBaseHeightOrZero(x - 1, y + 1); - highest = surfaceElement->base_height; + highest = surfaceElement->BaseHeight; for (std::size_t i = 0; i < std::size(cornerHeights); i++) highest = std::max(highest, cornerHeights[i]); - if (highest >= surfaceElement->base_height + 4) + if (highest >= surfaceElement->BaseHeight + 4) { count = 0; int32_t canCompensate = 1; @@ -88,9 +88,9 @@ int32_t MapSmooth(int32_t l, int32_t t, int32_t r, int32_t b) break; } - if (highestOnLowestSide > surfaceElement->base_height) + if (highestOnLowestSide > surfaceElement->BaseHeight) { - surfaceElement->base_height = surfaceElement->clearance_height = highestOnLowestSide; + surfaceElement->BaseHeight = surfaceElement->ClearanceHeight = highestOnLowestSide; raisedLand = 1; canCompensate = 0; } @@ -98,9 +98,9 @@ int32_t MapSmooth(int32_t l, int32_t t, int32_t r, int32_t b) if (count == 1 && canCompensate) { - if (surfaceElement->base_height < highest - 4) + if (surfaceElement->BaseHeight < highest - 4) { - surfaceElement->base_height = surfaceElement->clearance_height = highest - 4; + surfaceElement->BaseHeight = surfaceElement->ClearanceHeight = highest - 4; raisedLand = 1; } if (cornerHeights[0] == highest && cornerHeights[2] <= cornerHeights[0] - 4) @@ -114,9 +114,9 @@ int32_t MapSmooth(int32_t l, int32_t t, int32_t r, int32_t b) } else { - if (surfaceElement->base_height < highest - 2) + if (surfaceElement->BaseHeight < highest - 2) { - surfaceElement->base_height = surfaceElement->clearance_height = highest - 2; + surfaceElement->BaseHeight = surfaceElement->ClearanceHeight = highest - 2; raisedLand = 1; } } @@ -147,43 +147,43 @@ int32_t MapSmooth(int32_t l, int32_t t, int32_t r, int32_t b) uint8_t slope = surfaceElement->GetSlope(); // Corners auto surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x + 1, y + 1 }.ToCoordsXY()); - if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) + if (surfaceElement2 != nullptr && surfaceElement2->BaseHeight > surfaceElement->BaseHeight) slope |= TILE_ELEMENT_SLOPE_N_CORNER_UP; surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x - 1, y + 1 }.ToCoordsXY()); - if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) + if (surfaceElement2 != nullptr && surfaceElement2->BaseHeight > surfaceElement->BaseHeight) slope |= TILE_ELEMENT_SLOPE_W_CORNER_UP; surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x + 1, y - 1 }.ToCoordsXY()); - if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) + if (surfaceElement2 != nullptr && surfaceElement2->BaseHeight > surfaceElement->BaseHeight) slope |= TILE_ELEMENT_SLOPE_E_CORNER_UP; surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x - 1, y - 1 }.ToCoordsXY()); - if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) + if (surfaceElement2 != nullptr && surfaceElement2->BaseHeight > surfaceElement->BaseHeight) slope |= TILE_ELEMENT_SLOPE_S_CORNER_UP; // Sides surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x + 1, y + 0 }.ToCoordsXY()); - if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) + if (surfaceElement2 != nullptr && surfaceElement2->BaseHeight > surfaceElement->BaseHeight) slope |= TILE_ELEMENT_SLOPE_NE_SIDE_UP; surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x - 1, y + 0 }.ToCoordsXY()); - if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) + if (surfaceElement2 != nullptr && surfaceElement2->BaseHeight > surfaceElement->BaseHeight) slope |= TILE_ELEMENT_SLOPE_SW_SIDE_UP; surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x + 0, y - 1 }.ToCoordsXY()); - if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) + if (surfaceElement2 != nullptr && surfaceElement2->BaseHeight > surfaceElement->BaseHeight) slope |= TILE_ELEMENT_SLOPE_SE_SIDE_UP; surfaceElement2 = MapGetSurfaceElementAt(TileCoordsXY{ x + 0, y + 1 }.ToCoordsXY()); - if (surfaceElement2 != nullptr && surfaceElement2->base_height > surfaceElement->base_height) + if (surfaceElement2 != nullptr && surfaceElement2->BaseHeight > surfaceElement->BaseHeight) slope |= TILE_ELEMENT_SLOPE_NW_SIDE_UP; // Raise if (slope == TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) { slope = TILE_ELEMENT_SLOPE_FLAT; - surfaceElement->base_height = surfaceElement->clearance_height += 2; + surfaceElement->BaseHeight = surfaceElement->ClearanceHeight += 2; } surfaceElement->SetSlope(slope); } @@ -243,11 +243,11 @@ int32_t TileSmooth(const TileCoordsXY& tileCoords) // Get neighbour height. If the element is not valid (outside of map) assume the same height auto* neighbourSurfaceElement = MapGetSurfaceElementAt( (tileCoords + TileCoordsXY{ x_offset, y_offset }).ToCoordsXY()); - neighbourHeightOffset.baseheight[index] = neighbourSurfaceElement != nullptr ? neighbourSurfaceElement->base_height - : surfaceElement->base_height; + neighbourHeightOffset.baseheight[index] = neighbourSurfaceElement != nullptr ? neighbourSurfaceElement->BaseHeight + : surfaceElement->BaseHeight; // Make the height relative to the current surface element - neighbourHeightOffset.baseheight[index] -= surfaceElement->base_height; + neighbourHeightOffset.baseheight[index] -= surfaceElement->BaseHeight; index++; } @@ -289,7 +289,7 @@ int32_t TileSmooth(const TileCoordsXY& tileCoords) { // All corners are raised, raise the entire tile instead. surfaceElement->SetSlope(TILE_ELEMENT_SLOPE_FLAT); - surfaceElement->base_height = (surfaceElement->clearance_height += 2); + surfaceElement->BaseHeight = (surfaceElement->ClearanceHeight += 2); if (surfaceElement->GetWaterHeight() <= surfaceElement->GetBaseZ()) { surfaceElement->SetWaterHeight(0); @@ -302,9 +302,9 @@ int32_t TileSmooth(const TileCoordsXY& tileCoords) // Set correct clearance height if (slope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) - surfaceElement->clearance_height = surfaceElement->base_height + 4; + surfaceElement->ClearanceHeight = surfaceElement->BaseHeight + 4; else if (slope & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) - surfaceElement->clearance_height = surfaceElement->base_height + 2; + surfaceElement->ClearanceHeight = surfaceElement->BaseHeight + 2; } return 1; diff --git a/src/openrct2/world/TileElement.cpp b/src/openrct2/world/TileElement.cpp index 4a7b8600e9..9c47851982 100644 --- a/src/openrct2/world/TileElement.cpp +++ b/src/openrct2/world/TileElement.cpp @@ -106,9 +106,9 @@ void TileElement::ClearAs(TileElementType newType) type = 0; SetType(newType); Flags = 0; - base_height = MINIMUM_LAND_HEIGHT; - clearance_height = MINIMUM_LAND_HEIGHT; - owner = 0; + BaseHeight = MINIMUM_LAND_HEIGHT; + ClearanceHeight = MINIMUM_LAND_HEIGHT; + Owner = 0; std::fill_n(pad_05, sizeof(pad_05), 0x00); std::fill_n(pad_08, sizeof(pad_08), 0x00); } diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 9e81b95455..af82f93ec9 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -50,11 +50,11 @@ struct BannerElement; struct TileElementBase { - uint8_t type; // 0 - uint8_t Flags; // 1. Upper nibble: flags. Lower nibble: occupied quadrants (one bit per quadrant). - uint8_t base_height; // 2 - uint8_t clearance_height; // 3 - uint8_t owner; // 4 + uint8_t type; // 0 + uint8_t Flags; // 1. Upper nibble: flags. Lower nibble: occupied quadrants (one bit per quadrant). + uint8_t BaseHeight; // 2 + uint8_t ClearanceHeight; // 3 + uint8_t Owner; // 4 void Remove(); diff --git a/src/openrct2/world/TileElementBase.cpp b/src/openrct2/world/TileElementBase.cpp index 4116600ec7..10d041e584 100644 --- a/src/openrct2/world/TileElementBase.cpp +++ b/src/openrct2/world/TileElementBase.cpp @@ -98,31 +98,31 @@ void TileElementBase::SetOccupiedQuadrants(uint8_t quadrants) int32_t TileElementBase::GetBaseZ() const { - return base_height * COORDS_Z_STEP; + return BaseHeight * COORDS_Z_STEP; } void TileElementBase::SetBaseZ(int32_t newZ) { - base_height = (newZ / COORDS_Z_STEP); + BaseHeight = (newZ / COORDS_Z_STEP); } int32_t TileElementBase::GetClearanceZ() const { - return clearance_height * COORDS_Z_STEP; + return ClearanceHeight * COORDS_Z_STEP; } void TileElementBase::SetClearanceZ(int32_t newZ) { - clearance_height = (newZ / COORDS_Z_STEP); + ClearanceHeight = (newZ / COORDS_Z_STEP); } uint8_t TileElementBase::GetOwner() const { - return owner & OWNER_MASK; + return Owner & OWNER_MASK; } void TileElementBase::SetOwner(uint8_t newOwner) { - owner &= ~OWNER_MASK; - owner |= (newOwner & OWNER_MASK); + Owner &= ~OWNER_MASK; + Owner |= (newOwner & OWNER_MASK); } diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index f025fec731..68ee08992d 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -249,7 +249,7 @@ namespace OpenRCT2::TileInspector auto entrance = station.Entrance; auto exit = station.Exit; uint8_t entranceType = tileElement->AsEntrance()->GetEntranceType(); - uint8_t z = tileElement->base_height; + uint8_t z = tileElement->BaseHeight; // Make sure this is the correct entrance or exit if (entranceType == ENTRANCE_TYPE_RIDE_ENTRANCE && entrance.x == loc.x / COORDS_XY_STEP @@ -405,9 +405,9 @@ namespace OpenRCT2::TileInspector // While current element's base height is lower, or (when their baseheight is the same) the other map element's // clearance height is lower... while (currentId > 0 - && (otherElement->base_height > currentElement->base_height - || (otherElement->base_height == currentElement->base_height - && otherElement->clearance_height > currentElement->clearance_height))) + && (otherElement->BaseHeight > currentElement->BaseHeight + || (otherElement->BaseHeight == currentElement->BaseHeight + && otherElement->ClearanceHeight > currentElement->ClearanceHeight))) { if (!SwapTileElements(loc, currentId - 1, currentId)) { @@ -439,8 +439,8 @@ namespace OpenRCT2::TileInspector static GameActions::Result ValidateTileHeight(TileElement* const tileElement, int8_t heightOffset) { - int16_t newBaseHeight = static_cast(tileElement->base_height + heightOffset); - int16_t newClearanceHeight = static_cast(tileElement->clearance_height + heightOffset); + int16_t newBaseHeight = static_cast(tileElement->BaseHeight + heightOffset); + int16_t newClearanceHeight = static_cast(tileElement->ClearanceHeight + heightOffset); if (newBaseHeight < 0) { return GameActions::Result(GameActions::Status::TooLow, STR_CANT_LOWER_ELEMENT_HERE, STR_TOO_LOW); @@ -485,7 +485,7 @@ namespace OpenRCT2::TileInspector auto& station = ride->GetStation(entranceIndex); const auto& entranceLoc = station.Entrance; const auto& exitLoc = station.Exit; - uint8_t z = tileElement->base_height; + uint8_t z = tileElement->BaseHeight; // Make sure this is the correct entrance or exit if (entranceType == ENTRANCE_TYPE_RIDE_ENTRANCE && entranceLoc == TileCoordsXYZ{ loc, z }) @@ -496,8 +496,8 @@ namespace OpenRCT2::TileInspector } } - tileElement->base_height += heightOffset; - tileElement->clearance_height += heightOffset; + tileElement->BaseHeight += heightOffset; + tileElement->ClearanceHeight += heightOffset; MapInvalidateTileFull(loc); @@ -572,8 +572,8 @@ namespace OpenRCT2::TileInspector } } - surfaceElement->base_height += 2; - surfaceElement->clearance_height = surfaceElement->base_height; + surfaceElement->BaseHeight += 2; + surfaceElement->ClearanceHeight = surfaceElement->BaseHeight; } surfaceElement->SetSlope(newSlope); @@ -695,10 +695,10 @@ namespace OpenRCT2::TileInspector switch (entranceElement->AsEntrance()->GetEntranceType()) { case ENTRANCE_TYPE_RIDE_ENTRANCE: - station.Entrance = { loc, entranceElement->base_height, entranceElement->GetDirection() }; + station.Entrance = { loc, entranceElement->BaseHeight, entranceElement->GetDirection() }; break; case ENTRANCE_TYPE_RIDE_EXIT: - station.Exit = { loc, entranceElement->base_height, entranceElement->GetDirection() }; + station.Exit = { loc, entranceElement->BaseHeight, entranceElement->GetDirection() }; break; } @@ -817,8 +817,8 @@ namespace OpenRCT2::TileInspector // Keep? // invalidate_test_results(ride); - tileElement->base_height += offset; - tileElement->clearance_height += offset; + tileElement->BaseHeight += offset; + tileElement->ClearanceHeight += offset; } if (auto* inspector = GetTileInspectorWithPos(loc); inspector != nullptr)