From b39c08629387826b90b3dab577a4fa168b1138b5 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Thu, 26 May 2016 12:07:01 +0200 Subject: [PATCH] Draw station --- src/ride/transport/monorail.c | 37 ++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/ride/transport/monorail.c b/src/ride/transport/monorail.c index 49911e5530..550de5ccdd 100644 --- a/src/ride/transport/monorail.c +++ b/src/ride/transport/monorail.c @@ -467,9 +467,44 @@ static void paint_monorail_track_flat(uint8 rideIndex, uint8 trackSequence, uint paint_util_set_general_support_height(height + 32, 0x20); } -/** rct2: 0x */ +/** rct2: 0x008AE25C, 0x008AE26C, 0x008AE27C */ static void paint_monorail_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { + uint32 imageId; + + if (direction == 0 || direction == 2) { + imageId = SPR_STATION_BASE_B_SW_NE | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98197C(imageId, 0, 0, 32, 28, 2, height - 2, 0, 2, height, get_current_rotation()); + } else if (direction == 1 || direction == 3) { + imageId = SPR_STATION_BASE_B_NW_SE | RCT2_GLOBAL(0x00F441A0, uint32); + sub_98197C(imageId, 0, 0, 28, 32, 2, height - 2, 2, 0, height, get_current_rotation()); + } + + imageId = monorail_track_pieces_flat[direction] | RCT2_GLOBAL(0x00F44198, uint32); + if (direction == 0 || direction == 2) { + sub_98199C(imageId, 0, 6, 32, 20, 2, height, 0, 0, height, get_current_rotation()); + } else { + sub_98199C(imageId, 6, 0, 20, 32, 2, height, 0, 0, height, get_current_rotation()); + } + + if (direction == 0 || direction == 2) { + paint_util_push_tunnel_left(height, TUNNEL_6); + } else { + paint_util_push_tunnel_right(height, TUNNEL_6); + } + + if (direction == 0 || direction == 2) { + metal_a_supports_paint_setup(3, 5, 0, height, RCT2_GLOBAL(0x00F4419C, uint32)); + metal_a_supports_paint_setup(3, 8, 0, height, RCT2_GLOBAL(0x00F4419C, uint32)); + } else { + metal_a_supports_paint_setup(3, 6, 0, height, RCT2_GLOBAL(0x00F4419C, uint32)); + metal_a_supports_paint_setup(3, 7, 0, height, RCT2_GLOBAL(0x00F4419C, uint32)); + } + + track_paint_util_draw_station(rideIndex, trackSequence, direction, height, mapElement); + + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); } /** rct2: 0x008AE1BC */