1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 14:24:33 +01:00

Remove remaining access to additions field

This commit is contained in:
Gymnasiast
2018-09-16 18:21:10 +02:00
committed by Michael Steenbeek
parent a6885ea464
commit b1f737d985
4 changed files with 19 additions and 6 deletions

View File

@@ -2926,7 +2926,7 @@ static void peep_interact_with_path(rct_peep* peep, int16_t x, int16_t y, rct_ti
// Peep is not queuing.
peep->time_lost = 0;
uint8_t stationNum = (tile_element->properties.path.additions & 0x70) >> 4;
uint8_t stationNum = tile_element->AsPath()->GetStationIndex();
if ((tile_element->properties.path.type & (1 << 3)) // Queue has the ride sign on it
&& (tile_element->AsPath()->GetQueueBannerDirection()

View File

@@ -479,7 +479,7 @@ private:
case TILE_ELEMENT_TYPE_PATH:
{
uint8_t pathType = tileElement->AsPath()->GetRCT1PathType();
uint8_t pathAdditionsType = tileElement->properties.path.additions & 0x0F;
uint8_t pathAdditionsType = tileElement->AsPath()->GetAddition();
AddEntryForPath(pathType);
AddEntryForPathAddition(pathAdditionsType);

View File

@@ -271,7 +271,7 @@ static money32 footpath_element_insert(
tileElement->properties.path.type |= (slope & TILE_ELEMENT_SLOPE_W_CORNER_DN);
if (type & FOOTPATH_ELEMENT_INSERT_QUEUE)
tileElement->AsPath()->SetIsQueue(true);
tileElement->properties.path.additions = pathItemType;
tileElement->AsPath()->SetAddition(pathItemType);
tileElement->properties.path.addition_status = 255;
tileElement->flags &= ~TILE_ELEMENT_FLAG_BROKEN;
if (flags & GAME_COMMAND_FLAG_GHOST)
@@ -650,7 +650,7 @@ static money32 footpath_place_from_track(
tileElement->clearance_height = z + 4 + ((slope & TILE_ELEMENT_SLOPE_S_CORNER_UP) ? 2 : 0);
tileElement->properties.path.type = (type << 4) | (slope & TILE_ELEMENT_SLOPE_W_CORNER_DN);
tileElement->type |= type >> 7;
tileElement->properties.path.additions = 0;
tileElement->AsPath()->SetAddition(0);
tileElement->properties.path.addition_status = 255;
tileElement->properties.path.edges = edges & FOOTPATH_PROPERTIES_EDGES_EDGES_MASK;
tileElement->flags &= ~TILE_ELEMENT_FLAG_BROKEN;
@@ -1672,8 +1672,7 @@ void footpath_chain_ride_queue(
tileElement->properties.path.type &= ~FOOTPATH_PROPERTIES_FLAG_HAS_QUEUE_BANNER;
tileElement->properties.path.edges |= (1 << (direction ^ 2));
tileElement->properties.path.ride_index = rideIndex;
tileElement->properties.path.additions &= ~FOOTPATH_PROPERTIES_ADDITIONS_STATION_INDEX_MASK;
tileElement->properties.path.additions |= (entranceIndex << 4) & FOOTPATH_PROPERTIES_ADDITIONS_STATION_INDEX_MASK;
tileElement->AsPath()->SetStationIndex(entranceIndex);
map_invalidate_element(x, y, tileElement);
@@ -1991,6 +1990,17 @@ bool PathElement::HasQueueBanner() const
return (entryIndex & FOOTPATH_PROPERTIES_FLAG_HAS_QUEUE_BANNER) != 0;
}
uint8_t PathElement::GetStationIndex() const
{
return (additions & FOOTPATH_PROPERTIES_ADDITIONS_STATION_INDEX_MASK) >> 4;
}
void PathElement::SetStationIndex(uint8_t newStationIndex)
{
additions &= ~FOOTPATH_PROPERTIES_ADDITIONS_STATION_INDEX_MASK;
additions |= ((newStationIndex << 4) & FOOTPATH_PROPERTIES_ADDITIONS_STATION_INDEX_MASK);
}
bool PathElement::IsWide() const
{
return (type & FOOTPATH_ELEMENT_TYPE_FLAG_IS_WIDE) != 0;

View File

@@ -208,6 +208,9 @@ public:
bool IsSloped() const;
void SetSloped(bool isSloped);
uint8_t GetStationIndex() const;
void SetStationIndex(uint8_t newStationIndex);
bool IsWide() const;
void SetWide(bool isWide);