diff --git a/src/ride/gentle/car_ride.c b/src/ride/gentle/car_ride.c index 04cc64343e..143fd64b59 100644 --- a/src/ride/gentle/car_ride.c +++ b/src/ride/gentle/car_ride.c @@ -338,7 +338,7 @@ static void paint_car_ride_station(uint8 rideIndex, uint8 trackSequence, uint8 d static void paint_car_ride_track_right_quarter_turn_3_tiles(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { track_paint_util_right_quarter_turn_3_tiles_paint(3, height, direction, trackSequence, RCT2_GLOBAL(0x00F44198, uint32), car_ride_track_pieces_quarter_turn_3_tiles, defaultRightQuarterTurn3TilesOffsets, defaultRightQuarterTurn3TilesBoundLengths, NULL, get_current_rotation()); - track_paint_util_right_quarter_turn_3_tiles_tunnel(height, direction, trackSequence); + track_paint_util_right_quarter_turn_3_tiles_tunnel(height, direction, trackSequence, TUNNEL_0); switch (trackSequence) { case 0: diff --git a/src/ride/gentle/ghost_train.c b/src/ride/gentle/ghost_train.c index 1b1071799e..9c26d614fd 100644 --- a/src/ride/gentle/ghost_train.c +++ b/src/ride/gentle/ghost_train.c @@ -362,7 +362,7 @@ static void paint_ghost_train_station(uint8 rideIndex, uint8 trackSequence, uint static void paint_ghost_train_track_right_quarter_turn_3_tiles(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { track_paint_util_right_quarter_turn_3_tiles_paint(3, height, direction, trackSequence, RCT2_GLOBAL(0x00F44198, uint32), ghost_train_track_pieces_quarter_turn_3_tiles, NULL, defaultRightQuarterTurn3TilesBoundLengths, defaultRightQuarterTurn3TilesOffsets, get_current_rotation()); - track_paint_util_right_quarter_turn_3_tiles_tunnel(height, direction, trackSequence); + track_paint_util_right_quarter_turn_3_tiles_tunnel(height, direction, trackSequence, TUNNEL_0); switch (trackSequence) { case 0: diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index a28a22082c..8e6d20c3cd 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -712,24 +712,24 @@ void track_paint_util_right_quarter_turn_3_tiles_paint(sint8 thickness, sint16 h sub_98197C(imageId, (sint8) offset.x, (sint8) offset.y, boundsLength.x, boundsLength.y, thickness, height, boundsOffset.x, boundsOffset.y, height, rotation); } -void track_paint_util_right_quarter_turn_3_tiles_tunnel(sint16 height, uint8 direction, uint8 trackSequence) +void track_paint_util_right_quarter_turn_3_tiles_tunnel(sint16 height, uint8 direction, uint8 trackSequence, uint8 tunnelType) { if (direction == 0 && trackSequence == 0) { - paint_util_push_tunnel_left(height, TUNNEL_0); + paint_util_push_tunnel_left(height, tunnelType); } if (direction == 0 && trackSequence == 3) { - paint_util_push_tunnel_right(height, TUNNEL_0); + paint_util_push_tunnel_right(height, tunnelType); } if (direction == 1 && trackSequence == 3) { - paint_util_push_tunnel_left(height, TUNNEL_0); + paint_util_push_tunnel_left(height, tunnelType); } if (direction == 3 && trackSequence == 0) { - paint_util_push_tunnel_left(height, TUNNEL_0); + paint_util_push_tunnel_right(height, tunnelType); } } diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 4aaf1efd89..be522c3a93 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -201,7 +201,7 @@ void track_paint_util_draw_pier(rct_ride * ride, const rct_ride_entrance_definit void track_paint_util_right_quarter_turn_5_tiles_paint(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][5], const rct_xy16 offsets[4][5], const rct_xy16 boundsLengths[4][5], const rct_xy16 boundsOffsets[4][5], uint8 rotation); void track_paint_util_right_quarter_turn_5_tiles_paint_2(sint16 height, int direction, uint8 rotation, uint8 trackSequence, uint32 colourFlags, const sprite_bb sprites[][5]); void track_paint_util_right_quarter_turn_3_tiles_paint(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], const rct_xy16 offsets[4][3], const rct_xy16 boundsLengths[4][3], const rct_xy16 boundsOffsets[4][3], uint8 rotation); -void track_paint_util_right_quarter_turn_3_tiles_tunnel(sint16 height, uint8 direction, uint8 trackSequence); +void track_paint_util_right_quarter_turn_3_tiles_tunnel(sint16 height, uint8 direction, uint8 trackSequence, uint8 tunnelType); void track_paint_util_left_quarter_turn_3_tiles_paint(sint8 thickness, sint16 height, int direction, uint8 trackSequence, uint32 colourFlags, const uint32 sprites[4][3], uint8 rotation); void track_paint_util_left_quarter_turn_3_tiles_tunnel(sint16 height, uint8 direction, uint8 trackSequence); void track_paint_util_left_quarter_turn_1_tile_paint(sint8 thickness, sint16 height, sint16 boundBoxZOffset, int direction, uint32 colourFlags, const uint32 * sprites, uint8 rotation); diff --git a/src/ride/transport/monorail.c b/src/ride/transport/monorail.c index 1e2eda8ccf..25ccd3436b 100644 --- a/src/ride/transport/monorail.c +++ b/src/ride/transport/monorail.c @@ -61,6 +61,18 @@ enum SPR_MONORAIL_25_DEG_UP_TO_FLAT_SE_NW = 23263, SPR_MONORAIL_25_DEG_UP_TO_FLAT_NW_SE = 23264, + SPR_MONORAIL_QUARTER_TURN_3_TILES_SW_SE_PART_0 = 23281, + SPR_MONORAIL_QUARTER_TURN_3_TILES_SW_SE_PART_1 = 23282, + SPR_MONORAIL_QUARTER_TURN_3_TILES_SW_SE_PART_2 = 23283, + SPR_MONORAIL_QUARTER_TURN_3_TILES_NW_SW_PART_0 = 23284, + SPR_MONORAIL_QUARTER_TURN_3_TILES_NW_SW_PART_1 = 23285, + SPR_MONORAIL_QUARTER_TURN_3_TILES_NW_SW_PART_2 = 23286, + SPR_MONORAIL_QUARTER_TURN_3_TILES_NE_NW_PART_0 = 23287, + SPR_MONORAIL_QUARTER_TURN_3_TILES_NE_NW_PART_1 = 23288, + SPR_MONORAIL_QUARTER_TURN_3_TILES_NE_NW_PART_2 = 23289, + SPR_MONORAIL_QUARTER_TURN_3_TILES_SE_NE_PART_0 = 23290, + SPR_MONORAIL_QUARTER_TURN_3_TILES_SE_NE_PART_1 = 23291, + SPR_MONORAIL_QUARTER_TURN_3_TILES_SE_NE_PART_2 = 23292, SPR_MONORAIL_EIGHT_TO_DIAG_SW_E_PART_0 = 23293, SPR_MONORAIL_EIGHT_TO_DIAG_SW_E_PART_1 = 23294, SPR_MONORAIL_EIGHT_TO_DIAG_SW_E_PART_2 = 23295, @@ -154,6 +166,29 @@ static const uint32 monorail_track_pieces_25_deg_up_to_flat[4] = { SPR_MONORAIL_25_DEG_UP_TO_FLAT_SE_NW, }; +static const uint32 monorail_track_pieces_flat_quarter_turn_3_tiles[4][3] = { + { + SPR_MONORAIL_QUARTER_TURN_3_TILES_SW_SE_PART_0, + SPR_MONORAIL_QUARTER_TURN_3_TILES_SW_SE_PART_1, + SPR_MONORAIL_QUARTER_TURN_3_TILES_SW_SE_PART_2 + }, + { + SPR_MONORAIL_QUARTER_TURN_3_TILES_NW_SW_PART_0, + SPR_MONORAIL_QUARTER_TURN_3_TILES_NW_SW_PART_1, + SPR_MONORAIL_QUARTER_TURN_3_TILES_NW_SW_PART_2 + }, + { + SPR_MONORAIL_QUARTER_TURN_3_TILES_NE_NW_PART_0, + SPR_MONORAIL_QUARTER_TURN_3_TILES_NE_NW_PART_1, + SPR_MONORAIL_QUARTER_TURN_3_TILES_NE_NW_PART_2 + }, + { + SPR_MONORAIL_QUARTER_TURN_3_TILES_SE_NE_PART_0, + SPR_MONORAIL_QUARTER_TURN_3_TILES_SE_NE_PART_1, + SPR_MONORAIL_QUARTER_TURN_3_TILES_SE_NE_PART_2 + } +}; + static const uint32 ghost_train_track_pieces_right_eight_to_diag[4][4] = { { SPR_MONORAIL_EIGHT_TO_DIAG_SW_E_PART_0, @@ -510,14 +545,34 @@ static void paint_monorail_track_s_bend_right(uint8 rideIndex, uint8 trackSequen { } -/** rct2: 0x */ +/** rct2: 0x008AE29C */ static void paint_monorail_track_right_quarter_turn_3_tiles(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { + track_paint_util_right_quarter_turn_3_tiles_paint(3, height, direction, trackSequence, RCT2_GLOBAL(0x00F44198, uint32), monorail_track_pieces_flat_quarter_turn_3_tiles, defaultRightQuarterTurn3TilesOffsets, defaultRightQuarterTurn3TilesBoundLengths, NULL, get_current_rotation()); + track_paint_util_right_quarter_turn_3_tiles_tunnel(height, direction, trackSequence, TUNNEL_6); + + switch (trackSequence) { + case 0: + case 3: + metal_a_supports_paint_setup(3, 4, 0, height, RCT2_GLOBAL(0x00F4419C, uint32)); + break; + } + + int blockedSegments = 0; + switch (trackSequence) { + case 0: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC; break; + case 2: blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0; break; + case 3: blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(blockedSegments, direction), 0xFFFF, 0); + + paint_util_set_general_support_height(height + 32, 0x20); } -/** rct2: 0x */ +/** rct2: 0x008AE28C */ static void paint_monorail_track_left_quarter_turn_3_tiles(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ +{trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + paint_monorail_track_right_quarter_turn_3_tiles(rideIndex, trackSequence, (direction + 1) % 4, height, mapElement); } static const sint8 paint_monorail_eighth_to_diag_index[] = {0, 1, 2, -1, 3};