1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 23:34:37 +01:00

Replace C-style functions for getting direction

This commit is contained in:
Gymnasiast
2018-09-16 17:24:49 +02:00
committed by Michael Steenbeek
parent 015ece94c6
commit a6885ea464
6 changed files with 13 additions and 13 deletions

View File

@@ -1701,8 +1701,7 @@ void footpath_chain_ride_queue(
if (lastPathElement->AsPath()->IsQueue())
{
lastPathElement->properties.path.type |= FOOTPATH_PROPERTIES_FLAG_HAS_QUEUE_BANNER;
lastPathElement->type &= 0x3F; // Clear the ride sign direction
footpath_element_set_direction(lastPathElement, lastPathDirection); // set the ride sign direction
lastPathElement->AsPath()->SetQueueBannerDirection(lastPathDirection); // set the ride sign direction
map_animation_create(MAP_ANIMATION_TYPE_QUEUE_BANNER, lastPathX, lastPathY, lastPathElement->base_height);
}
@@ -2058,15 +2057,15 @@ void PathElement::SetEntryIndex(uint8_t newEntryIndex)
entryIndex |= (newEntryIndex << 4);
}
uint8_t footpath_element_get_direction(const rct_tile_element* tileElement)
uint8_t PathElement::GetQueueBannerDirection() const
{
return ((tileElement->type & FOOTPATH_ELEMENT_TYPE_DIRECTION_MASK) >> 6);
return ((type & FOOTPATH_ELEMENT_TYPE_DIRECTION_MASK) >> 6);
}
void footpath_element_set_direction(rct_tile_element* tileElement, uint8_t direction)
void PathElement::SetQueueBannerDirection(uint8_t direction)
{
tileElement->type &= ~FOOTPATH_ELEMENT_TYPE_DIRECTION_MASK;
tileElement->type |= (direction << 6);
type &= ~FOOTPATH_ELEMENT_TYPE_DIRECTION_MASK;
type |= (direction << 6);
}
/**