mirror of https://github.com/OpenRCT2/OpenRCT2.git
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.
This commit is contained in:
parent
4e6935f689
commit
4d3ba7a6f0
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue