diff --git a/src/openrct2-ui/input/InputManager.cpp b/src/openrct2-ui/input/InputManager.cpp index 75a176c0c7..4cd20245ee 100644 --- a/src/openrct2-ui/input/InputManager.cpp +++ b/src/openrct2-ui/input/InputManager.cpp @@ -158,9 +158,9 @@ void InputManager::HandleModifiers() if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) { if (gInputPlaceObjectModifier & (PLACE_OBJECT_MODIFIER_COPY_Z | PLACE_OBJECT_MODIFIER_SHIFT_Z)) - virtual_floor_enable(); + VirtualFloorEnable(); else - virtual_floor_disable(); + VirtualFloorDisable(); } } diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index b130bba44e..06523811dd 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1346,7 +1346,7 @@ static void Sub6E1F34SmallScenery( if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) { - virtual_floor_set_height(gSceneryPlaceZ); + VirtualFloorSetHeight(gSceneryPlaceZ); } *outQuadrant = quadrant ^ 2; @@ -1430,7 +1430,7 @@ static void Sub6E1F34SmallScenery( if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) { - virtual_floor_set_height(gSceneryPlaceZ); + VirtualFloorSetHeight(gSceneryPlaceZ); } *outQuadrant = 0; @@ -1464,7 +1464,7 @@ static void Sub6E1F34PathItem( if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) { - virtual_floor_set_height(gSceneryPlaceZ); + VirtualFloorSetHeight(gSceneryPlaceZ); } *outZ = info.Element->GetBaseZ(); @@ -1553,7 +1553,7 @@ static void Sub6E1F34Wall( if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) { - virtual_floor_set_height(gSceneryPlaceZ); + VirtualFloorSetHeight(gSceneryPlaceZ); } *outEdges = edge; @@ -1652,7 +1652,7 @@ static void Sub6E1F34LargeScenery( if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) { - virtual_floor_set_height(gSceneryPlaceZ); + VirtualFloorSetHeight(gSceneryPlaceZ); } *outDirection = rotation; @@ -1700,7 +1700,7 @@ static void Sub6E1F34Banner( if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) { - virtual_floor_set_height(gSceneryPlaceZ); + VirtualFloorSetHeight(gSceneryPlaceZ); } *outDirection = rotation; @@ -2613,7 +2613,7 @@ static void TopToolbarToolUpdateScenery(const ScreenCoordsXY& screenPos) if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) { - virtual_floor_invalidate(); + VirtualFloorInvalidate(); } gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; diff --git a/src/openrct2/paint/VirtualFloor.cpp b/src/openrct2/paint/VirtualFloor.cpp index f8fa402eda..6597d453a1 100644 --- a/src/openrct2/paint/VirtualFloor.cpp +++ b/src/openrct2/paint/VirtualFloor.cpp @@ -41,26 +41,26 @@ enum VirtualFloorFlags VIRTUAL_FLOOR_FORCE_INVALIDATION = (1 << 2), }; -bool virtual_floor_is_enabled() +bool VirtualFloorIsEnabled() { return (_virtualFloorFlags & VIRTUAL_FLOOR_FLAG_ENABLED) != 0; } -void virtual_floor_set_height(int16_t height) +void VirtualFloorSetHeight(int16_t height) { - if (!virtual_floor_is_enabled()) + if (!VirtualFloorIsEnabled()) { return; } if (_virtualFloorHeight != height) { - virtual_floor_invalidate(); + VirtualFloorInvalidate(); _virtualFloorHeight = height; } } -static void virtual_floor_reset() +static void VirtualFloorReset() { _virtualFloorLastMinPos.x = std::numeric_limits::max(); _virtualFloorLastMinPos.y = std::numeric_limits::max(); @@ -69,20 +69,20 @@ static void virtual_floor_reset() _virtualFloorHeight = 0; } -void virtual_floor_enable() +void VirtualFloorEnable() { - if (virtual_floor_is_enabled()) + if (VirtualFloorIsEnabled()) { return; } - virtual_floor_reset(); + VirtualFloorReset(); _virtualFloorFlags |= VIRTUAL_FLOOR_FLAG_ENABLED; } -void virtual_floor_disable() +void VirtualFloorDisable() { - if (!virtual_floor_is_enabled()) + if (!VirtualFloorIsEnabled()) { return; } @@ -91,13 +91,13 @@ void virtual_floor_disable() // Force invalidation, even if the position hasn't changed. _virtualFloorFlags |= VIRTUAL_FLOOR_FORCE_INVALIDATION; - virtual_floor_invalidate(); + VirtualFloorInvalidate(); _virtualFloorFlags &= ~VIRTUAL_FLOOR_FORCE_INVALIDATION; - virtual_floor_reset(); + VirtualFloorReset(); } -void virtual_floor_invalidate() +void VirtualFloorInvalidate() { PROFILED_FUNCTION(); @@ -174,9 +174,9 @@ void virtual_floor_invalidate() } } -bool virtual_floor_tile_is_floor(const CoordsXY& loc) +bool VirtualFloorTileIsFloor(const CoordsXY& loc) { - if (!virtual_floor_is_enabled()) + if (!VirtualFloorIsEnabled()) { return false; } @@ -206,7 +206,7 @@ bool virtual_floor_tile_is_floor(const CoordsXY& loc) return false; } -static void virtual_floor_get_tile_properties( +static void VirtualFloorGetTileProperties( const CoordsXY& loc, int16_t height, bool* outOccupied, bool* tileOwned, uint8_t* outOccupiedEdges, bool* outBelowGround, bool* aboveGround, bool* outLit) { @@ -292,7 +292,7 @@ static void virtual_floor_get_tile_properties( } } -void virtual_floor_paint(paint_session& session) +void VirtualFloorPaint(paint_session& session) { PROFILED_FUNCTION(); @@ -322,7 +322,7 @@ void virtual_floor_paint(paint_session& session) bool weAreAboveGround; uint8_t litEdges = 0; - virtual_floor_get_tile_properties( + VirtualFloorGetTileProperties( session.MapPosition, virtualFloorClipHeight, &weAreOccupied, &weAreOwned, &occupiedEdges, &weAreBelowGround, &weAreAboveGround, &weAreLit); @@ -345,7 +345,7 @@ void virtual_floor_paint(paint_session& session) bool theyAreOwned; bool theyAreAboveGround; - virtual_floor_get_tile_properties( + VirtualFloorGetTileProperties( theirLocation, virtualFloorClipHeight, &theyAreOccupied, &theyAreOwned, &theirOccupiedEdges, &theyAreBelowGround, &theyAreAboveGround, &theyAreLit); @@ -412,7 +412,7 @@ void virtual_floor_paint(paint_session& session) } } -uint16_t virtual_floor_get_height() +uint16_t VirtualFloorGetHeight() { return _virtualFloorHeight; } diff --git a/src/openrct2/paint/VirtualFloor.h b/src/openrct2/paint/VirtualFloor.h index 2a2f3279d6..c01ba51c24 100644 --- a/src/openrct2/paint/VirtualFloor.h +++ b/src/openrct2/paint/VirtualFloor.h @@ -22,15 +22,15 @@ enum class VirtualFloorStyles : int32_t struct paint_session; -uint16_t virtual_floor_get_height(); +uint16_t VirtualFloorGetHeight(); -bool virtual_floor_is_enabled(); -void virtual_floor_set_height(int16_t height); +bool VirtualFloorIsEnabled(); +void VirtualFloorSetHeight(int16_t height); -void virtual_floor_enable(); -void virtual_floor_disable(); -void virtual_floor_invalidate(); +void VirtualFloorEnable(); +void VirtualFloorDisable(); +void VirtualFloorInvalidate(); -bool virtual_floor_tile_is_floor(const CoordsXY& loc); +bool VirtualFloorTileIsFloor(const CoordsXY& loc); -void virtual_floor_paint(paint_session& session); +void VirtualFloorPaint(paint_session& session); diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index 239d6ed5ef..04c89beaa2 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -145,7 +145,7 @@ static void PaintTileElementBase(paint_session& session, const CoordsXY& origCoo if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off) { - partOfVirtualFloor = virtual_floor_tile_is_floor(session.MapPosition); + partOfVirtualFloor = VirtualFloorTileIsFloor(session.MapPosition); } switch (rotation) @@ -204,7 +204,7 @@ static void PaintTileElementBase(paint_session& session, const CoordsXY& origCoo if (partOfVirtualFloor) { // We must pretend this tile is at least as tall as the virtual floor - max_height = std::max(max_height, virtual_floor_get_height()); + max_height = std::max(max_height, VirtualFloorGetHeight()); } if (screenMinY - (max_height + 32) >= dpi->y + dpi->height) @@ -291,7 +291,7 @@ static void PaintTileElementBase(paint_session& session, const CoordsXY& origCoo if (gConfigGeneral.virtual_floor_style != VirtualFloorStyles::Off && partOfVirtualFloor) { - virtual_floor_paint(session); + VirtualFloorPaint(session); } if (!gShowSupportSegmentHeights) diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index a38f46bd0c..060c3472e5 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -763,7 +763,7 @@ void ride_select_next_section() } // Invalidate previous track piece (we may not be changing height!) - virtual_floor_invalidate(); + VirtualFloorInvalidate(); CoordsXYE inputElement, outputElement; inputElement.x = newCoords->x; @@ -777,7 +777,7 @@ void ride_select_next_section() if (!scenery_tool_is_active()) { // Set next element's height. - virtual_floor_set_height(tileElement->GetBaseZ()); + VirtualFloorSetHeight(tileElement->GetBaseZ()); } _currentTrackBegin = *newCoords; @@ -830,7 +830,7 @@ void ride_select_previous_section() } // Invalidate previous track piece (we may not be changing height!) - virtual_floor_invalidate(); + VirtualFloorInvalidate(); track_begin_end trackBeginEnd; if (track_block_get_previous({ *newCoords, tileElement }, &trackBeginEnd)) @@ -844,7 +844,7 @@ void ride_select_previous_section() if (!scenery_tool_is_active()) { // Set previous element's height. - virtual_floor_set_height(trackBeginEnd.begin_element->GetBaseZ()); + VirtualFloorSetHeight(trackBeginEnd.begin_element->GetBaseZ()); } window_ride_construction_update_active_elements(); } diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index 6e9074e074..17f96b3b64 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -64,12 +64,12 @@ money32 place_provisional_track_piece( viewport_set_visibility(2); // Invalidate previous track piece (we may not be changing height!) - virtual_floor_invalidate(); + VirtualFloorInvalidate(); if (!scenery_tool_is_active()) { // Set new virtual floor height. - virtual_floor_set_height(trackPos.z); + VirtualFloorSetHeight(trackPos.z); } return result.Cost; @@ -106,12 +106,12 @@ money32 place_provisional_track_piece( viewport_set_visibility(2); // Invalidate previous track piece (we may not be changing height!) - virtual_floor_invalidate(); + VirtualFloorInvalidate(); if (!scenery_tool_is_active()) { // Set height to where the next track piece would begin - virtual_floor_set_height(trackPos.z - z_begin + z_end); + VirtualFloorSetHeight(trackPos.z - z_begin + z_end); } return res.Cost; diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index bc4ab55238..e9ce139fb9 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -166,26 +166,26 @@ money32 FootpathProvisionalSet( } // Invalidate previous footpath piece. - virtual_floor_invalidate(); + VirtualFloorInvalidate(); if (!scenery_tool_is_active()) { if (res.Error != GameActions::Status::Ok) { // If we can't build this, don't show a virtual floor. - virtual_floor_set_height(0); + VirtualFloorSetHeight(0); } else if ( gFootpathConstructSlope == TILE_ELEMENT_SLOPE_FLAT || gProvisionalFootpath.Position.z < gFootpathConstructFromPosition.z) { // Going either straight on, or down. - virtual_floor_set_height(gProvisionalFootpath.Position.z); + VirtualFloorSetHeight(gProvisionalFootpath.Position.z); } else { // Going up in the world! - virtual_floor_set_height(gProvisionalFootpath.Position.z + LAND_HEIGHT_STEP); + VirtualFloorSetHeight(gProvisionalFootpath.Position.z + LAND_HEIGHT_STEP); } }