1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Move door state functions to struct methods

This commit is contained in:
Gymnasiast
2018-09-17 21:57:12 +02:00
parent 8908f3f47e
commit 3b80d049ef
2 changed files with 9 additions and 4 deletions

View File

@@ -2330,12 +2330,12 @@ void TrackElement::SetTrackType(uint8_t newType)
trackType = newType;
}
uint8_t track_element_get_door_a_state(const rct_tile_element* tileElement)
uint8_t TrackElement::GetDoorAState() const
{
return (tileElement->properties.track.colour & TRACK_ELEMENT_DOOR_A_MASK) >> 2;
return (colour & TRACK_ELEMENT_DOOR_A_MASK) >> 2;
}
uint8_t track_element_get_door_b_state(const rct_tile_element* tileElement)
uint8_t TrackElement::GetDoorBState() const
{
return (tileElement->properties.track.colour & TRACK_ELEMENT_DOOR_B_MASK) >> 5;
return (colour & TRACK_ELEMENT_DOOR_B_MASK) >> 5;
}

View File

@@ -259,6 +259,11 @@ public:
uint8_t GetSequenceIndex() const;
void SetSequenceIndex(uint8_t newSequenceIndex);
// Used in RCT1, will be reintroduced at some point.
// (See https://github.com/OpenRCT2/OpenRCT2/issues/7059)
uint8_t GetDoorAState() const;
uint8_t GetDoorBState() const;
};
assert_struct_size(TrackElement, 8);