From 4d3ba7a6f055da9fc26ce22d228644bb42e30606 Mon Sep 17 00:00:00 2001 From: Richard Fine Date: Mon, 7 Sep 2020 13:21:19 -0400 Subject: [PATCH] Rename PathElement::Edges for clarity PathElement::Edges actualy stores both 'edges' (in the lower 4 bits) and 'corners' in the upper four. Rename the variable to make this dual usage easier to see. --- src/openrct2/world/Footpath.cpp | 16 ++++++++-------- src/openrct2/world/TileElement.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 2aa76dd4db..30f4991be1 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -2219,34 +2219,34 @@ void PathElement::SetAdditionStatus(uint8_t newStatus) uint8_t PathElement::GetEdges() const { - return Edges & FOOTPATH_PROPERTIES_EDGES_EDGES_MASK; + return EdgesAndCorners & FOOTPATH_PROPERTIES_EDGES_EDGES_MASK; } void PathElement::SetEdges(uint8_t newEdges) { - Edges &= ~FOOTPATH_PROPERTIES_EDGES_EDGES_MASK; - Edges |= (newEdges & FOOTPATH_PROPERTIES_EDGES_EDGES_MASK); + EdgesAndCorners &= ~FOOTPATH_PROPERTIES_EDGES_EDGES_MASK; + EdgesAndCorners |= (newEdges & FOOTPATH_PROPERTIES_EDGES_EDGES_MASK); } uint8_t PathElement::GetCorners() const { - return Edges >> 4; + return EdgesAndCorners >> 4; } void PathElement::SetCorners(uint8_t newCorners) { - Edges &= ~FOOTPATH_PROPERTIES_EDGES_CORNERS_MASK; - Edges |= (newCorners << 4); + EdgesAndCorners &= ~FOOTPATH_PROPERTIES_EDGES_CORNERS_MASK; + EdgesAndCorners |= (newCorners << 4); } uint8_t PathElement::GetEdgesAndCorners() const { - return Edges; + return EdgesAndCorners; } void PathElement::SetEdgesAndCorners(uint8_t newEdgesAndCorners) { - Edges = newEdgesAndCorners; + EdgesAndCorners = newEdgesAndCorners; } bool PathElement::IsLevelCrossing(const CoordsXY& coords) const diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index e307bad97a..9d6b40f521 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -203,7 +203,7 @@ private: PathRailingsIndex RailingsIndex; // 6 #pragma clang diagnostic pop uint8_t Additions; // 7 (0 means no addition) - uint8_t Edges; // 8 + uint8_t EdgesAndCorners;// 8 (edges in lower 4 bits, corners in upper 4) uint8_t Flags2; // 9 uint8_t SlopeDirection; // 10 union