Move getting seat rotation to struct methods

This commit is contained in:
Gymnasiast committed 2018-09-25 21:57:21 +02:00
1 parent ae4c464ce7
commit 6bd732ce5a
7 files changed
+15 -14

No files matched your search

+1 -1
View File
@@ -2484,7 +2484,7 @@ void window_ride_construction_update_active_elements_impl()
_selectedTrackType = tileElement->AsTrack()->GetTrackType();
if (track_element_has_speed_setting(tileElement->AsTrack()->GetTrackType()))
_currentBrakeSpeed2 = tile_element_get_brake_booster_speed(tileElement);
_currentSeatRotationAngle = track_element_get_seat_rotation(tileElement);
_currentSeatRotationAngle = tileElement->AsTrack()->GetSeatRotation();
}
}
+1 -1
View File
@@ -1398,7 +1398,7 @@ int32_t sub_6C683D(
}
if (flags & (1 << 5))
{
track_element_set_seat_rotation(tileElement, (uint8_t)(extra_params & 0xFF));
tileElement->AsTrack()->SetSeatRotation((uint8_t)(extra_params & 0xFF));
}
if (flags & (1 << 3))
+6 -6
View File
@@ -1487,7 +1487,7 @@ static money32 track_place(
}
else
{
track_element_set_seat_rotation(tileElement, seatRotation);
tileElement->AsTrack()->SetSeatRotation(seatRotation);
}
if (liftHillAndAlternativeState & RIDE_TYPE_ALTERNATIVE_TRACK_TYPE)
@@ -2222,15 +2222,15 @@ bool track_element_has_speed_setting(uint8_t trackType)
return trackType == TRACK_ELEM_BRAKES || trackType == TRACK_ELEM_BOOSTER;
}
uint8_t track_element_get_seat_rotation(const rct_tile_element* tileElement)
uint8_t TrackElement::GetSeatRotation() const
{
return tileElement->properties.track.colour >> 4;
return colour >> 4;
}
void track_element_set_seat_rotation(rct_tile_element* tileElement, uint8_t seatRotation)
void TrackElement::SetSeatRotation(uint8_t newSeatRotation)
{
tileElement->properties.track.colour &= 0x0F;
tileElement->properties.track.colour |= (seatRotation << 4);
colour &= 0x0F;
colour |= (newSeatRotation << 4);
}
uint8_t track_element_get_colour_scheme(const rct_tile_element* tileElement)
-2
View File
@@ -566,8 +566,6 @@ void game_command_set_brakes_speed(
int32_t* eax, int32_t* ebx, int32_t* ecx, int32_t* edx, int32_t* esi, int32_t* edi, int32_t* ebp);
bool track_element_is_booster(uint8_t rideType, uint8_t trackType);
bool track_element_has_speed_setting(uint8_t trackType);
uint8_t track_element_get_seat_rotation(const rct_tile_element* tileElement);
void track_element_set_seat_rotation(rct_tile_element* tileElement, uint8_t seatRotation);
uint8_t track_element_get_colour_scheme(const rct_tile_element* tileElement);
void track_element_set_colour_scheme(rct_tile_element* tileElement, uint8_t colourScheme);
int32_t tile_element_get_station(const rct_tile_element* tileElement);
+1 -1
View File
@@ -1052,7 +1052,7 @@ static bool track_design_save_to_td6_for_tracked_ride(uint8_t rideIndex, rct_tra
}
else
{
bh = track_element_get_seat_rotation(trackElement.element);
bh = trackElement.element->AsTrack()->GetSeatRotation();
}
uint8_t flags = (trackElement.element->type & (1 << 7)) | bh;
+3 -3
View File
@@ -8113,7 +8113,7 @@ loc_6DB41D:
trackType = tileElement->AsTrack()->GetTrackType();
if (trackType != TRACK_ELEM_BRAKES)
{
vehicle->target_seat_rotation = track_element_get_seat_rotation(tileElement);
vehicle->target_seat_rotation = tileElement->AsTrack()->GetSeatRotation();
}
vehicle->track_direction = regs.bl & 3;
vehicle->track_type |= trackType << 2;
@@ -8531,7 +8531,7 @@ static bool vehicle_update_track_motion_backwards_get_new_track(
trackType = tileElement->AsTrack()->GetTrackType();
if (trackType != TRACK_ELEM_BRAKES)
{
vehicle->target_seat_rotation = track_element_get_seat_rotation(tileElement);
vehicle->target_seat_rotation = tileElement->AsTrack()->GetSeatRotation();
}
direction &= 3;
vehicle->track_type = trackType << 2;
@@ -9155,7 +9155,7 @@ loc_6DCA9A:
}
vehicle->track_type = (tileElement->AsTrack()->GetTrackType() << 2) | (direction & 3);
vehicle->var_CF = track_element_get_seat_rotation(tileElement) << 1;
vehicle->var_CF = tileElement->AsTrack()->GetSeatRotation() << 1;
// There are two bytes before the move info list
regs.ax = vehicle_get_move_info_size(vehicle->var_CD, vehicle->track_type);
+3
View File
@@ -260,6 +260,9 @@ public:
uint8_t GetSequenceIndex() const;
void SetSequenceIndex(uint8_t newSequenceIndex);
uint8_t GetSeatRotation() const;
void SetSeatRotation(uint8_t newSeatRotation);
// Used in RCT1, will be reintroduced at some point.
// (See https://github.com/OpenRCT2/OpenRCT2/issues/7059)
uint8_t GetDoorAState() const;