From 5f0db41e48c810e6cb756c1aefb76d738fb99c85 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 1 Mar 2020 14:39:18 +0100 Subject: [PATCH] Process @duncanspumpkin 's feedback on #10830 (#10853) --- .../paint/tile_element/Paint.Surface.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index 7808fee8ad..e09e646f24 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -905,31 +905,29 @@ static void viewport_surface_draw_water_side_top( static std::pair surface_get_height_above_water( const SurfaceElement& surfaceElement, const int32_t height, const int32_t surfaceShape) { - int32_t local_surfaceShape = surfaceShape; - int32_t local_height = height; + int32_t localSurfaceShape = surfaceShape; + int32_t localHeight = height; if (surfaceElement.GetWaterHeight() > 0) { int32_t waterHeight = surfaceElement.GetWaterHeight(); if (waterHeight > height) { - local_height += (2 * COORDS_Z_STEP); + localHeight += (2 * COORDS_Z_STEP); - if (waterHeight != local_height || !(local_surfaceShape & TILE_ELEMENT_SURFACE_DIAGONAL_FLAG)) + if (waterHeight != localHeight || !(localSurfaceShape & TILE_ELEMENT_SURFACE_DIAGONAL_FLAG)) { - local_height = waterHeight; - local_surfaceShape = 0; + localHeight = waterHeight; + localSurfaceShape = TILE_ELEMENT_SLOPE_FLAT; } else { - int32_t bl = (surfaceShape ^ 0xF) << 2; - int32_t bh = bl >> 4; - local_surfaceShape = (bh & 0x3) | (bl & 0xC); + localSurfaceShape = ror4(surfaceShape ^ TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK, 2); } } } - return { local_height, local_surfaceShape }; + return { localHeight, localSurfaceShape }; } /**