From 6ef01b3cd3dc655939241e5df5179a443c0f9519 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Fri, 18 Jan 2019 20:35:43 +0100 Subject: [PATCH] Name some path drawing variables --- .../paint/tile_element/Paint.Path.cpp | 24 +++++++++++-------- .../paint/tile_element/Paint.TileElement.h | 2 +- src/openrct2/peep/Staff.cpp | 2 +- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 5732d9c01a..124bc3e130 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -30,8 +30,12 @@ bool gPaintWidePathsAsGhost = false; // clang-format off -const uint8_t byte_98D800[] = { - 12, 9, 3, 6 +const uint8_t PathSlopeToLandSlope[] = +{ + TILE_ELEMENT_SLOPE_SW_SIDE_UP, + TILE_ELEMENT_SLOPE_NW_SIDE_UP, + TILE_ELEMENT_SLOPE_NE_SIDE_UP, + TILE_ELEMENT_SLOPE_SE_SIDE_UP }; static constexpr const uint8_t byte_98D6E0[] = { @@ -794,7 +798,7 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile { session->InteractionType = VIEWPORT_INTERACTION_ITEM_FOOTPATH; - bool word_F3F038 = false; + bool hasSupports = false; uint32_t sceneryImageFlags = 0; uint32_t imageFlags = 0; @@ -851,11 +855,11 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile uint16_t bl = height / 8; if (surface == nullptr) { - word_F3F038 = true; + hasSupports = true; } else if (surface->base_height != bl) { - word_F3F038 = true; + hasSupports = true; } else { @@ -863,16 +867,16 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile { // Diagonal path - if (surface->AsSurface()->GetSlope() != byte_98D800[tile_element->AsPath()->GetSlopeDirection()]) + if (surface->AsSurface()->GetSlope() != PathSlopeToLandSlope[tile_element->AsPath()->GetSlopeDirection()]) { - word_F3F038 = true; + hasSupports = true; } } else { if (surface->AsSurface()->GetSlope() != TILE_ELEMENT_SLOPE_FLAT) { - word_F3F038 = true; + hasSupports = true; } } } @@ -932,12 +936,12 @@ void path_paint(paint_session* session, uint16_t height, const TileElement* tile if (railingEntry->support_type == FOOTPATH_ENTRY_SUPPORT_TYPE_POLE) { path_paint_pole_support( - session, tile_element, height, footpathEntry, railingEntry, word_F3F038, imageFlags, sceneryImageFlags); + session, tile_element, height, footpathEntry, railingEntry, hasSupports, imageFlags, sceneryImageFlags); } else { path_paint_box_support( - session, tile_element, height, footpathEntry, railingEntry, word_F3F038, imageFlags, sceneryImageFlags); + session, tile_element, height, footpathEntry, railingEntry, hasSupports, imageFlags, sceneryImageFlags); } } diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.h b/src/openrct2/paint/tile_element/Paint.TileElement.h index 97628c70a1..ac6a3baf55 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.h +++ b/src/openrct2/paint/tile_element/Paint.TileElement.h @@ -87,7 +87,7 @@ extern bool gShowSupportSegmentHeights; extern const LocationXY16 BannerBoundBoxes[][2]; -extern const uint8_t byte_98D800[4]; +extern const uint8_t PathSlopeToLandSlope[4]; void paint_util_push_tunnel_left(paint_session* session, uint16_t height, uint8_t type); void paint_util_push_tunnel_right(paint_session* session, uint16_t height, uint8_t type); diff --git a/src/openrct2/peep/Staff.cpp b/src/openrct2/peep/Staff.cpp index 4b4240f942..7e5adbb2c2 100644 --- a/src/openrct2/peep/Staff.cpp +++ b/src/openrct2/peep/Staff.cpp @@ -951,7 +951,7 @@ static uint8_t staff_handyman_direction_to_uncut_grass(rct_peep* peep, uint8_t v if (peep->GetNextIsSloped()) { - if (tileElement->AsSurface()->GetSlope() != byte_98D800[peep->GetNextDirection()]) + if (tileElement->AsSurface()->GetSlope() != PathSlopeToLandSlope[peep->GetNextDirection()]) return 0xFF; } else if (tileElement->AsSurface()->GetSlope() != TILE_ELEMENT_SLOPE_FLAT)