1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Fix multi-dimension roller coaster painting

This commit is contained in:
Ted John
2016-10-09 23:28:27 +01:00
parent e5a662440f
commit 83dcff66b6

View File

@@ -81,6 +81,41 @@ static void multi_dimension_rc_track_flat(uint8 rideIndex, uint8 trackSequence,
}
}
static void multi_dimension_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
static const uint32 imageIds[4][3] = {
{ 15810, 15812, SPR_STATION_INVERTED_BAR_A_SW_NE },
{ 15811, 15813, SPR_STATION_INVERTED_BAR_A_NW_SE },
{ 15810, 15812, SPR_STATION_INVERTED_BAR_A_SW_NE },
{ 15811, 15813, SPR_STATION_INVERTED_BAR_A_NW_SE },
};
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 {
sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 26, 1, height, 0, 3, height + 3);
}
track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 11);
rct_ride * ride = get_ride(rideIndex);
const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style];
if (direction == 0 || direction == 2) {
track_paint_util_draw_station_covers(EDGE_NW, false, entranceStyle, direction, height);
} else {
track_paint_util_draw_station_covers(EDGE_NE, false, entranceStyle, direction, height);
}
if (direction == 0 || direction == 2) {
track_paint_util_draw_station_covers(EDGE_SE, false, entranceStyle, direction, height);
} else {
track_paint_util_draw_station_covers(EDGE_SW, false, entranceStyle, direction, height);
}
paint_util_push_tunnel_rotated(direction, height, TUNNEL_6);
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
paint_util_set_general_support_height(height + 32, 0x20);
}
static void multi_dimension_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement)
{
if (!track_element_is_inverted(mapElement)) {
@@ -3833,32 +3868,27 @@ static void multi_dimension_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackS
metal_a_supports_paint_setup(11, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]);
metal_a_supports_paint_setup(11, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15806, 0, 0, 32, 20, 0, height, 0, 6, height + 3);
sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25623, 26, 0, 1, 1, 19, height + 3);
break;
case 1:
sub_98196C_rotated(direction, 0x20000000 | 22432, 0, 0, 32, 32, 1, height);
metal_a_supports_paint_setup(11, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]);
metal_a_supports_paint_setup(11, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15807, 0, 0, 32, 20, 0, height, 0, 6, height + 3);
sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25624, 6, 0, 1, 1, 19, height + 3);
break;
case 2:
sub_98196C_rotated(direction, 0x20000000 | 22432, 0, 0, 32, 32, 1, height);
metal_a_supports_paint_setup(11, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]);
metal_a_supports_paint_setup(11, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15806, 0, 0, 32, 20, 0, height, 0, 6, height + 3);
sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25625, 6, 0, 1, 1, 19, height + 3);
break;
case 3:
sub_98196C_rotated(direction, 0x20000000 | 22432, 0, 0, 32, 32, 1, height);
metal_a_supports_paint_setup(11, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]);
metal_a_supports_paint_setup(11, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15807, 0, 0, 32, 20, 0, height, 0, 6, height + 3);
sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25626, 26, 0, 1, 1, 19, height + 3);
break;
}
sub_98196C_rotated(direction, 0x00000000, 0, 0, 0, 0, 0, height - 48);
sub_98196C_rotated(direction, 0x00000000, 0, 0, 0, 0, 0, height - 48);
track_paint_util_onride_photo_paint(direction, height + 3, mapElement);
paint_util_push_tunnel_rotated(direction, height, TUNNEL_6);
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
paint_util_set_general_support_height(height + 48, 0x20);
@@ -3869,32 +3899,27 @@ static void multi_dimension_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackS
metal_a_supports_paint_setup(11, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]);
metal_a_supports_paint_setup(11, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26227, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 24);
sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25623, 26, 0, 1, 1, 19, height + 3);
break;
case 1:
sub_98196C_rotated(direction, 0x20000000 | 22432, 0, 0, 32, 32, 1, height);
metal_a_supports_paint_setup(11, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]);
metal_a_supports_paint_setup(11, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26228, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 24);
sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25624, 6, 0, 1, 1, 19, height + 3);
break;
case 2:
sub_98196C_rotated(direction, 0x20000000 | 22432, 0, 0, 32, 32, 1, height);
metal_a_supports_paint_setup(11, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]);
metal_a_supports_paint_setup(11, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26227, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 24);
sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25625, 6, 0, 1, 1, 19, height + 3);
break;
case 3:
sub_98196C_rotated(direction, 0x20000000 | 22432, 0, 0, 32, 32, 1, height);
metal_a_supports_paint_setup(11, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]);
metal_a_supports_paint_setup(11, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]);
sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26228, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 24);
sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25626, 26, 0, 1, 1, 19, height + 3);
break;
}
sub_98196C_rotated(direction, 0x00000000, 0, 0, 0, 0, 0, height - 48);
sub_98196C_rotated(direction, 0x00000000, 0, 0, 0, 0, 0, height - 48);
track_paint_util_onride_photo_paint(direction, height + 3, mapElement);
paint_util_push_tunnel_rotated(direction, height, TUNNEL_6);
paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0);
paint_util_set_general_support_height(height + 64, 0x20);
@@ -9260,6 +9285,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_multi_dimension_rc(int trackType,
switch (trackType) {
case TRACK_ELEM_FLAT:
return multi_dimension_rc_track_flat;
case TRACK_ELEM_END_STATION:
case TRACK_ELEM_BEGIN_STATION:
case TRACK_ELEM_MIDDLE_STATION:
return multi_dimension_rc_track_station;
case TRACK_ELEM_25_DEG_UP:
return multi_dimension_rc_track_25_deg_up;
case TRACK_ELEM_60_DEG_UP: