mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix station drawing
This commit is contained in:
parent
c26b5ec2b8
commit
76188d2c4c
|
@ -94,6 +94,8 @@ static void multi_dimension_rc_track_station(uint8 rideIndex, uint8 trackSequenc
|
|||
{ 15811, 15813, SPR_STATION_INVERTED_BAR_A_NW_SE },
|
||||
};
|
||||
|
||||
rct_xy16 position = {gPaintMapPosition.x, gPaintMapPosition.y};
|
||||
|
||||
if (mapElement->properties.track.type == TRACK_ELEM_END_STATION) {
|
||||
sub_98197C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 26, 1, height, 0, 3, height + 3);
|
||||
} else {
|
||||
|
@ -103,16 +105,21 @@ static void multi_dimension_rc_track_station(uint8 rideIndex, uint8 trackSequenc
|
|||
|
||||
rct_ride * ride = get_ride(rideIndex);
|
||||
const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style];
|
||||
bool hasFence;
|
||||
if (direction == 0 || direction == 2) {
|
||||
track_paint_util_draw_station_covers(EDGE_NW, false, entranceStyle, direction, height);
|
||||
hasFence = track_paint_util_has_fence(EDGE_NW, position, mapElement, ride, get_current_rotation());
|
||||
track_paint_util_draw_station_covers(EDGE_NW, hasFence, entranceStyle, direction, height);
|
||||
} else {
|
||||
track_paint_util_draw_station_covers(EDGE_NE, false, entranceStyle, direction, height);
|
||||
hasFence = track_paint_util_has_fence(EDGE_NE, position, mapElement, ride, get_current_rotation());
|
||||
track_paint_util_draw_station_covers(EDGE_NE, hasFence, entranceStyle, direction, height);
|
||||
}
|
||||
|
||||
if (direction == 0 || direction == 2) {
|
||||
track_paint_util_draw_station_covers(EDGE_SE, false, entranceStyle, direction, height);
|
||||
hasFence = track_paint_util_has_fence(EDGE_SE, position, mapElement, ride, get_current_rotation());
|
||||
track_paint_util_draw_station_covers(EDGE_SE, hasFence, entranceStyle, direction, height);
|
||||
} else {
|
||||
track_paint_util_draw_station_covers(EDGE_SW, false, entranceStyle, direction, height);
|
||||
hasFence = track_paint_util_has_fence(EDGE_SW, position, mapElement, ride, get_current_rotation());
|
||||
track_paint_util_draw_station_covers(EDGE_SW, hasFence, entranceStyle, direction, height);
|
||||
}
|
||||
|
||||
paint_util_push_tunnel_rotated(direction, height, TUNNEL_6);
|
||||
|
|
|
@ -285,12 +285,24 @@ bool track_paint_util_should_paint_supports(rct_xy16 position)
|
|||
return false;
|
||||
}
|
||||
|
||||
void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
|
||||
void track_paint_util_draw_station_impl(uint8 rideIndex, uint8 trackSequence, uint8 direction, uint16 height, uint16 coverHeight, rct_map_element * mapElement, int fenceOffsetA, int fenceOffsetB);
|
||||
|
||||
void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, uint16 height, rct_map_element * mapElement)
|
||||
{
|
||||
track_paint_util_draw_station_2(rideIndex, trackSequence, direction, height, mapElement, 5, 7);
|
||||
track_paint_util_draw_station_impl(rideIndex, trackSequence, direction, height, height, mapElement, 5, 7);
|
||||
}
|
||||
|
||||
void track_paint_util_draw_station_2(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement, int fenceOffsetA, int fenceOffsetB)
|
||||
void track_paint_util_draw_station_2(uint8 rideIndex, uint8 trackSequence, uint8 direction, uint16 height, rct_map_element * mapElement, int fenceOffsetA, int fenceOffsetB)
|
||||
{
|
||||
track_paint_util_draw_station_impl(rideIndex, trackSequence, direction, height, height, mapElement, fenceOffsetA, fenceOffsetB);
|
||||
}
|
||||
|
||||
void track_paint_util_draw_station_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, uint16 height, uint16 coverHeight, rct_map_element * mapElement)
|
||||
{
|
||||
track_paint_util_draw_station_impl(rideIndex, trackSequence, direction, height, coverHeight, mapElement, 5, 7);
|
||||
}
|
||||
|
||||
void track_paint_util_draw_station_impl(uint8 rideIndex, uint8 trackSequence, uint8 direction, uint16 height, uint16 coverHeight, rct_map_element * mapElement, int fenceOffsetA, int fenceOffsetB)
|
||||
{
|
||||
rct_xy16 position = {gPaintMapPosition.x, gPaintMapPosition.y};
|
||||
rct_ride * ride = get_ride(rideIndex);
|
||||
|
@ -317,7 +329,7 @@ void track_paint_util_draw_station_2(uint8 rideIndex, uint8 trackSequence, uint8
|
|||
}
|
||||
sub_98196C(imageId, 0, 0, 32, 8, 1, height + fenceOffsetA, get_current_rotation());
|
||||
//height -= 5 (height)
|
||||
track_paint_util_draw_station_covers(EDGE_NW, hasFence, entranceStyle, direction, height);
|
||||
track_paint_util_draw_station_covers(EDGE_NW, hasFence, entranceStyle, direction, coverHeight);
|
||||
//height += 5 (height + 5)
|
||||
|
||||
if (mapElement->properties.track.type == TRACK_ELEM_END_STATION && direction == 0) {
|
||||
|
@ -350,7 +362,7 @@ void track_paint_util_draw_station_2(uint8 rideIndex, uint8 trackSequence, uint8
|
|||
sub_98196C(imageId, 31, 23, 1, 8, 7, height + fenceOffsetB, get_current_rotation());
|
||||
}
|
||||
//height -= 7 (height)
|
||||
track_paint_util_draw_station_covers(EDGE_SE, hasFence, entranceStyle, direction, height);
|
||||
track_paint_util_draw_station_covers(EDGE_SE, hasFence, entranceStyle, direction, coverHeight);
|
||||
//height += 7 (height + 7)
|
||||
|
||||
if (mapElement->properties.track.type == TRACK_ELEM_BEGIN_STATION && direction == 0) {
|
||||
|
@ -377,7 +389,7 @@ void track_paint_util_draw_station_2(uint8 rideIndex, uint8 trackSequence, uint8
|
|||
}
|
||||
sub_98196C(imageId, 0, 0, 8, 32, 1, height + fenceOffsetA, get_current_rotation());
|
||||
//height -= 5 (height)
|
||||
track_paint_util_draw_station_covers(EDGE_NE, hasFence, entranceStyle, direction, height);
|
||||
track_paint_util_draw_station_covers(EDGE_NE, hasFence, entranceStyle, direction, coverHeight);
|
||||
//height += 5 (height + 5)
|
||||
|
||||
if (mapElement->properties.track.type == TRACK_ELEM_END_STATION && direction == 3) {
|
||||
|
@ -411,7 +423,7 @@ void track_paint_util_draw_station_2(uint8 rideIndex, uint8 trackSequence, uint8
|
|||
}
|
||||
|
||||
//height -= 7 (height)
|
||||
track_paint_util_draw_station_covers(EDGE_SW, hasFence, entranceStyle, direction, height);
|
||||
track_paint_util_draw_station_covers(EDGE_SW, hasFence, entranceStyle, direction, coverHeight);
|
||||
//height += 7 (height + 7)
|
||||
|
||||
if (mapElement->properties.track.type == TRACK_ELEM_BEGIN_STATION && direction == 3) {
|
||||
|
|
|
@ -273,8 +273,9 @@ void track_paint_util_paint_fences(uint8 edges, rct_xy16 position, rct_map_eleme
|
|||
bool track_paint_util_draw_station_covers(enum edge edge, bool hasFence, const rct_ride_entrance_definition * entranceStyle, uint8 direction, uint16 height);
|
||||
bool track_paint_util_draw_station_covers_2(enum edge edge, bool hasFence, const rct_ride_entrance_definition * entranceStyle, uint8 direction, uint16 height, uint8 stationVariant);
|
||||
void track_paint_util_draw_station_platform(rct_ride *ride, uint8 direction, int height, int zOffset, rct_map_element * mapElement);
|
||||
void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement);
|
||||
void track_paint_util_draw_station_2(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement, int fenceOffsetA, int fenceOffsetB);
|
||||
void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, uint16 height, rct_map_element * mapElement);
|
||||
void track_paint_util_draw_station_2(uint8 rideIndex, uint8 trackSequence, uint8 direction, uint16 height, rct_map_element * mapElement, int fenceOffsetA, int fenceOffsetB);
|
||||
void track_paint_util_draw_station_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, uint16 height, uint16 coverHeight, rct_map_element * mapElement);
|
||||
void track_paint_util_draw_station_inverted(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement, uint8 stationVariant);
|
||||
bool track_paint_util_should_paint_supports(rct_xy16 position);
|
||||
void track_paint_util_draw_pier(rct_ride * ride, const rct_ride_entrance_definition * entranceStyle, rct_xy16 position, uint8 direction, int height, rct_map_element * mapElement, uint8 rotation);
|
||||
|
|
|
@ -611,7 +611,7 @@ static void paint_miniature_railway_station(uint8 rideIndex, uint8 trackSequence
|
|||
|
||||
paint_util_push_tunnel_rotated(direction, height, TUNNEL_6);
|
||||
|
||||
track_paint_util_draw_station(rideIndex, trackSequence, direction, height + 2, mapElement);
|
||||
track_paint_util_draw_station_3(rideIndex, trackSequence, direction, height + 2, height, mapElement);
|
||||
// covers shouldn't be offset by +2
|
||||
|
||||
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
|
||||
|
|
|
@ -205,7 +205,7 @@ static void paint_log_flume_track_station(uint8 rideIndex, uint8 trackSequence,
|
|||
metal_a_supports_paint_setup(3, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]);
|
||||
}
|
||||
|
||||
track_paint_util_draw_station(rideIndex, trackSequence, direction, height + 2, mapElement);
|
||||
track_paint_util_draw_station_3(rideIndex, trackSequence, direction, height + 2, height, mapElement);
|
||||
// covers shouldn't be offset by +2
|
||||
|
||||
paint_util_push_tunnel_rotated(direction, height, TUNNEL_6);
|
||||
|
|
Loading…
Reference in New Issue