From e5141c0f69da3e7d3786e886a829a441bf48b4da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:03:45 +0200 Subject: [PATCH 01/55] Include copyright notice in ride generator --- test/testpaint/generate.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/testpaint/generate.cpp b/test/testpaint/generate.cpp index b2694924b3..9504ed56aa 100644 --- a/test/testpaint/generate.cpp +++ b/test/testpaint/generate.cpp @@ -63,11 +63,40 @@ private: void Generate() { + GenerateCopyrightHeader(); GenerateIncludes(); GenerateTrackFunctions(); GenerateMainFunction(); } + void GenerateCopyrightHeader() + { + const char * copyrights[] = + { + "#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers", + "/*****************************************************************************", + " * OpenRCT2, an open source clone of Roller Coaster Tycoon 2.", + " *", + " * OpenRCT2 is the work of many authors, a full list can be found in contributors.md", + " * For more information, visit https://github.com/OpenRCT2/OpenRCT2", + " *", + " * OpenRCT2 is free software: you can redistribute it and/or modify", + " * it under the terms of the GNU General Public License as published by", + " * the Free Software Foundation, either version 3 of the License, or", + " * (at your option) any later version.", + " *", + " * A full copy of the GNU General Public License can be found in licence.txt", + " *****************************************************************************/", + "#pragma endregion", + }; + + for (const auto copyright : copyrights) + { + WriteLine(0, copyright); + } + WriteLine(); + } + void GenerateIncludes() { const char * includes[] = From 482e7c15f0840a8017ac05765bf8f31cacf98701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:17:02 +0200 Subject: [PATCH 02/55] Add generated Spiral RC --- src/ride/coaster/spiral_roller_coaster.c | 6317 ++++++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 6319 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/spiral_roller_coaster.c b/src/ride/coaster/spiral_roller_coaster.c index 846fd9695d..7d08f66e18 100644 --- a/src/ride/coaster/spiral_roller_coaster.c +++ b/src/ride/coaster/spiral_roller_coaster.c @@ -13,3 +13,6320 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void spiral_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19044, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19045, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19046, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19047, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18738, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18739, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void spiral_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19056, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19057, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19058, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19059, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18796, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18797, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18798, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18799, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void spiral_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18812, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 38, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18813, 0, 0, 32, 1, 98, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 38, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18814, 0, 0, 32, 1, 98, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 38, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18815, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 38, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void spiral_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19048, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19049, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19050, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19051, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18788, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18789, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18790, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18791, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void spiral_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18800, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 18, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18801, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18804, 0, 0, 32, 1, 66, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 18, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18802, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18805, 0, 0, 32, 1, 66, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 18, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18803, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 18, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void spiral_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18806, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 26, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18807, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18810, 0, 0, 32, 1, 66, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 26, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18808, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18811, 0, 0, 32, 1, 66, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 26, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18809, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 26, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void spiral_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19052, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19053, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19054, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19055, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18792, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18793, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18794, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18795, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void spiral_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18851, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18856, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18861, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18846, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18850, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18855, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18860, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18845, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18849, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18854, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18859, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18844, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18848, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18853, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18858, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18843, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18847, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18852, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18857, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18842, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + spiral_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void spiral_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18748, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18756, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18749, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18757, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18750, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18751, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void spiral_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18752, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18753, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18754, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18758, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18755, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18759, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void spiral_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18754, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18758, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18755, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18759, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18752, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18753, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void spiral_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18750, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18751, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18748, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18756, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18749, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18757, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void spiral_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18871, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18882, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18876, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18881, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18866, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18870, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18875, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18880, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18865, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18869, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18874, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18879, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18864, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18868, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18873, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18878, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18863, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18867, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18872, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18877, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18883, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18862, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + spiral_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void spiral_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18760, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18764, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18761, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18765, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18762, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18763, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void spiral_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18766, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18767, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18768, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18770, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18769, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18771, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void spiral_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18772, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18776, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18773, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18777, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18774, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18775, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void spiral_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18778, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18779, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18780, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18782, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18781, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18783, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void spiral_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18784, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18785, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18786, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18787, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void spiral_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18936, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18941, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18946, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18951, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18937, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18942, 0, 0, 32, 16, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18947, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18952, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18938, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18943, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18948, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18953, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18939, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18944, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18949, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18954, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18940, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18945, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18950, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18955, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void spiral_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18916, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18921, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18926, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18931, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18917, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18922, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18927, 0, 0, 32, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18932, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18918, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18923, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18928, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18933, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18919, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18924, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18929, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18934, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18920, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18925, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18930, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18935, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void spiral_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + spiral_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void spiral_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + spiral_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void spiral_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18900, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18904, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18903, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18907, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18901, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(1, 5, 3, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18905, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18902, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18906, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18902, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18906, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18901, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(1, 5, 3, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18905, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18903, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18907, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18900, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18904, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18908, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18912, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18911, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18915, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18909, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18913, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18910, 0, 0, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18914, 0, 0, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18910, 0, 0, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18914, 0, 0, 32, 26, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18909, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18913, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18911, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18915, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18908, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18912, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18821, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18824, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18827, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18818, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18820, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18823, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18826, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18817, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18819, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18822, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18825, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18816, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + spiral_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void spiral_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18833, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18840, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18836, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18839, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18830, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18832, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18835, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18838, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18829, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18831, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18834, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18837, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18841, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18828, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + spiral_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void spiral_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18967, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18969, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18971, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18965, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18966, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18968, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18970, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18964, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void spiral_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18956, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18958, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18960, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18962, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18957, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18959, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18961, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(2, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18963, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void spiral_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + spiral_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void spiral_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + spiral_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void spiral_rc_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18991, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18998, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18994, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18997, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18988, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18990, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18993, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18996, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18987, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18989, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18992, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18995, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18999, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18986, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18988, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18991, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18998, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18994, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18997, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18987, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18990, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18993, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18996, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18986, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18989, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18992, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18995, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18999, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18972, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18975, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18978, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18981, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18985, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 11, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18973, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18976, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18979, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18982, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18974, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18977, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18984, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18980, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18983, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18975, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18978, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18981, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18985, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 11, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18972, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18976, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18979, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18982, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18973, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18977, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18984, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18980, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18983, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18974, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + spiral_rc_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void spiral_rc_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + spiral_rc_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void spiral_rc_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19031, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19042, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19036, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19041, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19026, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19030, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19035, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19040, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19025, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19029, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19034, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19039, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19024, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19028, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19033, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19038, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19023, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19027, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19032, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19037, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19043, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19022, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19026, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19031, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19042, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19036, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19041, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19025, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19030, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19035, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19040, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19024, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19029, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19034, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19039, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19023, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19028, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19033, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19038, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19022, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19027, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19032, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19037, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19043, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19000, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19005, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19010, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19015, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19021, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19001, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19006, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19011, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19016, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19002, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19007, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19012, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19017, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19003, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19008, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19013, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19018, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19004, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19009, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19020, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19014, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19019, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19005, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19010, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19015, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19021, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19000, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19006, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19011, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19016, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19001, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19007, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19012, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19017, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19002, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19008, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19013, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19018, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19003, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19009, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19020, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19014, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19019, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19004, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + spiral_rc_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void spiral_rc_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + spiral_rc_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void spiral_rc_track_left_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18893, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18897, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18894, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18898, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18895, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18899, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18892, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18896, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_left(height - 8, TUNNEL_8); + break; + case 2: + paint_util_push_tunnel_right(height + 56, TUNNEL_7); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_7); + paint_util_push_tunnel_left(height + 56, TUNNEL_7); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void spiral_rc_track_right_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18884, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18888, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18885, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18889, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18886, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18890, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18887, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18891, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 56, TUNNEL_7); + paint_util_push_tunnel_left(height - 8, TUNNEL_7); + break; + case 1: + paint_util_push_tunnel_left(height + 56, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_7); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void spiral_rc_track_left_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_right_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void spiral_rc_track_right_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_left_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void spiral_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18740, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18741, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void spiral_rc_track_25_deg_up_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19222, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19223, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19224, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19225, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void spiral_rc_track_25_deg_up_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19226, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19227, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19228, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19229, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void spiral_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, 0x20000000 | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(1, 5, 6, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18738, 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(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18739, 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(1, 5, 6, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18738, 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(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18739, 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); + 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); +} + +static void spiral_rc_track_25_deg_down_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_25_deg_up_right_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_25_deg_down_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_25_deg_up_left_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19076, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19080, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19084, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19088, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19077, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19081, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19085, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19089, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19078, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19082, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19086, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19090, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19079, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(1, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19083, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(2, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19087, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(1, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19091, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(2, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19060, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19064, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19068, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19072, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19061, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19065, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19069, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19073, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19062, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19066, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19070, 0, 0, 28, 28, 3, height, 4, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19074, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19063, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19067, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19071, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19075, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + spiral_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + spiral_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void spiral_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19108, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19112, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19116, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19120, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19109, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19113, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19117, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19121, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19110, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19114, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19118, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19122, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19111, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(1, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19115, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(2, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19119, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(1, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19123, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(2, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19092, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19096, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19100, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19104, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19093, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19097, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19101, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19105, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19094, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19098, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19102, 0, 0, 28, 28, 0, height, 4, 4, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19106, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19095, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19099, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19103, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19107, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + spiral_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + spiral_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void spiral_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19189, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19127, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19186, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19124, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19188, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19126, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19187, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19125, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19201, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19139, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19198, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19136, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19200, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19138, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19199, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19137, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void spiral_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19151, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19148, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19150, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 38, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19149, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 42, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 38, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 42, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void spiral_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19193, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19131, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19190, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19128, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19192, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19130, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19191, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19129, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void spiral_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19143, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19140, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19142, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 22, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19141, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 22, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 22, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 22, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void spiral_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19147, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19144, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19146, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 27, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19145, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(2, 0, 27, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 27, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 27, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void spiral_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19197, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19135, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19194, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19132, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19196, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19134, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19195, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19133, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void spiral_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19199, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19137, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19200, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19138, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19198, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19136, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19201, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19139, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void spiral_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19149, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19150, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19148, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 30, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19151, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 34, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 30, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 34, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void spiral_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19195, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19133, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19196, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19134, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19194, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19132, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19197, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19135, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void spiral_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19145, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19146, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19144, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 23, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19147, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 23, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 23, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 23, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void spiral_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19141, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19142, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19140, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19143, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void spiral_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19191, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19129, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19192, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19130, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19190, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19128, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19193, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19131, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void spiral_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19159, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19156, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19160, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19158, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19157, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19164, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19161, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19163, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19165, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19162, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19162, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19163, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19165, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19161, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19164, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19157, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19158, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19156, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19160, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19159, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19179, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19176, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19180, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19178, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19177, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void spiral_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19184, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19181, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19183, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19185, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19182, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void spiral_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19169, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19166, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19170, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19168, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19167, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void spiral_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19174, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19171, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19173, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19175, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19172, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void spiral_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19172, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19173, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19175, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19171, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19174, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void spiral_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19167, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19168, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19166, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19170, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19169, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void spiral_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19182, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19183, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19185, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19181, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19184, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void spiral_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19177, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19178, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19176, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19180, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19179, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void spiral_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19155, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19152, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19154, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19153, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19153, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19154, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19152, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19155, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void spiral_rc_track_left_curved_lift_hill(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19333, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19335, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19337, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19331, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19332, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(2, 4, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19334, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(1, 4, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19336, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(2, 4, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19330, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(1, 4, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 16, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 16, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void spiral_rc_track_right_curved_lift_hill(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19322, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19324, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19326, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19328, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19323, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(2, 4, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19325, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(1, 4, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19327, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(2, 4, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19329, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(1, 4, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 16, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 16, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void spiral_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18742, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18743, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void spiral_rc_track_left_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19317, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19319, 0, 6, 32, 1, 34, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19321, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19315, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19316, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19318, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19320, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19314, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void spiral_rc_track_right_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19306, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19308, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19310, 0, 6, 32, 1, 34, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19312, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19307, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19309, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19311, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19313, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void spiral_rc_track_left_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + spiral_rc_track_right_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void spiral_rc_track_right_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + spiral_rc_track_left_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void spiral_rc_track_left_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19286, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19291, 0, 0, 32, 1, 34, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19296, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19301, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19287, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19292, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19297, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19302, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19288, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19293, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19298, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19303, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19289, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19294, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19299, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19304, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19290, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19295, 0, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19300, 0, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19305, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void spiral_rc_track_right_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19266, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19271, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19276, 0, 0, 32, 1, 34, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19281, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19267, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19272, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19277, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19282, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19268, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19273, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19278, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19283, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19269, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19274, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19279, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19284, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19270, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19275, 0, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19280, 0, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19285, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void spiral_rc_track_left_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + spiral_rc_track_right_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void spiral_rc_track_right_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + spiral_rc_track_left_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void spiral_rc_track_25_deg_up_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19230, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19231, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19238, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19232, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19233, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void spiral_rc_track_25_deg_up_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19234, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19235, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19236, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19239, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19237, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void spiral_rc_track_left_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19240, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19241, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19248, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19242, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19243, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void spiral_rc_track_right_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19244, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19245, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19246, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19249, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19247, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void spiral_rc_track_25_deg_down_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_right_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_25_deg_down_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_left_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_left_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_25_deg_up_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_right_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_25_deg_up_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_left_banked_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19250, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19251, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19252, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19253, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void spiral_rc_track_right_banked_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19254, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19255, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19256, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19257, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void spiral_rc_track_left_banked_25_deg_up_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19258, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19259, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19260, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19261, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void spiral_rc_track_right_banked_25_deg_up_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19262, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19263, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19264, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19265, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void spiral_rc_track_left_banked_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_right_banked_25_deg_up_to_right_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_right_banked_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_left_banked_25_deg_up_to_left_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_left_banked_25_deg_down_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_right_banked_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_right_banked_25_deg_down_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_left_banked_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19202, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19203, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19210, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19204, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19205, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void spiral_rc_track_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19206, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19207, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19208, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19211, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19209, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void spiral_rc_track_left_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19212, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19213, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19220, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19214, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19215, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void spiral_rc_track_right_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19216, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19217, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19218, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19221, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19219, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void spiral_rc_track_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_right_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_left_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_left_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void spiral_rc_track_right_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + spiral_rc_track_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_spiral_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return spiral_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return spiral_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return spiral_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return spiral_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return spiral_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return spiral_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return spiral_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return spiral_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return spiral_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return spiral_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return spiral_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return spiral_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return spiral_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return spiral_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return spiral_rc_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return spiral_rc_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return spiral_rc_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return spiral_rc_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return spiral_rc_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return spiral_rc_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return spiral_rc_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return spiral_rc_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return spiral_rc_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return spiral_rc_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return spiral_rc_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return spiral_rc_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return spiral_rc_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return spiral_rc_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return spiral_rc_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return spiral_rc_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return spiral_rc_track_right_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: + return spiral_rc_track_left_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: + return spiral_rc_track_right_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return spiral_rc_track_left_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return spiral_rc_track_right_quarter_turn_5_25_deg_down; + case TRACK_ELEM_S_BEND_LEFT: + return spiral_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return spiral_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return spiral_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return spiral_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return spiral_rc_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return spiral_rc_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return spiral_rc_track_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return spiral_rc_track_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return spiral_rc_track_left_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return spiral_rc_track_right_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: + return spiral_rc_track_left_half_banked_helix_up_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: + return spiral_rc_track_right_half_banked_helix_up_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: + return spiral_rc_track_left_half_banked_helix_down_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: + return spiral_rc_track_right_half_banked_helix_down_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: + return spiral_rc_track_left_half_banked_helix_up_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: + return spiral_rc_track_right_half_banked_helix_up_large; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: + return spiral_rc_track_left_half_banked_helix_down_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: + return spiral_rc_track_right_half_banked_helix_down_large; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP: + return spiral_rc_track_left_quarter_turn_1_60_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP: + return spiral_rc_track_right_quarter_turn_1_60_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return spiral_rc_track_left_quarter_turn_1_60_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return spiral_rc_track_right_quarter_turn_1_60_deg_down; + case TRACK_ELEM_BRAKES: + return spiral_rc_track_brakes; + case TRACK_ELEM_25_DEG_UP_LEFT_BANKED: + return spiral_rc_track_25_deg_up_left_banked; + case TRACK_ELEM_25_DEG_UP_RIGHT_BANKED: + return spiral_rc_track_25_deg_up_right_banked; + case TRACK_ELEM_ON_RIDE_PHOTO: + return spiral_rc_track_on_ride_photo; + case TRACK_ELEM_25_DEG_DOWN_LEFT_BANKED: + return spiral_rc_track_25_deg_down_left_banked; + case TRACK_ELEM_25_DEG_DOWN_RIGHT_BANKED: + return spiral_rc_track_25_deg_down_right_banked; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return spiral_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return spiral_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return spiral_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return spiral_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + return spiral_rc_track_left_eighth_bank_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + return spiral_rc_track_right_eighth_bank_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + return spiral_rc_track_left_eighth_bank_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + return spiral_rc_track_right_eighth_bank_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return spiral_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return spiral_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP: + return spiral_rc_track_diag_60_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return spiral_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + return spiral_rc_track_diag_25_deg_up_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + return spiral_rc_track_diag_60_deg_up_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return spiral_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return spiral_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN: + return spiral_rc_track_diag_60_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return spiral_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + return spiral_rc_track_diag_25_deg_down_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + return spiral_rc_track_diag_60_deg_down_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return spiral_rc_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + return spiral_rc_track_diag_flat_to_left_bank; + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + return spiral_rc_track_diag_flat_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + return spiral_rc_track_diag_left_bank_to_flat; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + return spiral_rc_track_diag_right_bank_to_flat; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + return spiral_rc_track_diag_left_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + return spiral_rc_track_diag_right_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + return spiral_rc_track_diag_25_deg_up_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + return spiral_rc_track_diag_25_deg_up_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + return spiral_rc_track_diag_left_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + return spiral_rc_track_diag_right_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + return spiral_rc_track_diag_25_deg_down_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + return spiral_rc_track_diag_25_deg_down_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK: + return spiral_rc_track_diag_left_bank; + case TRACK_ELEM_DIAG_RIGHT_BANK: + return spiral_rc_track_diag_right_bank; + case TRACK_ELEM_LEFT_CURVED_LIFT_HILL: + return spiral_rc_track_left_curved_lift_hill; + case TRACK_ELEM_RIGHT_CURVED_LIFT_HILL: + return spiral_rc_track_right_curved_lift_hill; + case TRACK_ELEM_BLOCK_BRAKES: + return spiral_rc_track_block_brakes; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return spiral_rc_track_left_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return spiral_rc_track_right_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return spiral_rc_track_left_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return spiral_rc_track_right_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return spiral_rc_track_left_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return spiral_rc_track_right_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return spiral_rc_track_left_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return spiral_rc_track_right_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANKED_25_DEG_UP: + return spiral_rc_track_25_deg_up_to_left_banked_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANKED_25_DEG_UP: + return spiral_rc_track_25_deg_up_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return spiral_rc_track_left_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return spiral_rc_track_right_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANKED_25_DEG_DOWN: + return spiral_rc_track_25_deg_down_to_left_banked_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANKED_25_DEG_DOWN: + return spiral_rc_track_25_deg_down_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return spiral_rc_track_left_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return spiral_rc_track_right_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return spiral_rc_track_left_banked_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return spiral_rc_track_right_banked_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_LEFT_BANKED_FLAT: + return spiral_rc_track_left_banked_25_deg_up_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_RIGHT_BANKED_FLAT: + return spiral_rc_track_right_banked_25_deg_up_to_right_banked_flat; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return spiral_rc_track_left_banked_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return spiral_rc_track_right_banked_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_LEFT_BANKED_FLAT: + return spiral_rc_track_left_banked_25_deg_down_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_RIGHT_BANKED_FLAT: + return spiral_rc_track_right_banked_25_deg_down_to_right_banked_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return spiral_rc_track_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return spiral_rc_track_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_FLAT: + return spiral_rc_track_left_banked_25_deg_up_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_FLAT: + return spiral_rc_track_right_banked_25_deg_up_to_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return spiral_rc_track_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return spiral_rc_track_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_FLAT: + return spiral_rc_track_left_banked_25_deg_down_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_FLAT: + return spiral_rc_track_right_banked_25_deg_down_to_flat; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 3e8a8423ba..53382369cd 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6241,7 +6241,7 @@ const track_curve_chain gFlatRideTrackCurveChain[256] = { }; const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { - 0, // RIDE_TYPE_SPIRAL_ROLLER_COASTER + get_track_paint_function_spiral_rc, // RIDE_TYPE_SPIRAL_ROLLER_COASTER 0, // RIDE_TYPE_STAND_UP_ROLLER_COASTER 0, // RIDE_TYPE_SUSPENDED_SWINGING_COASTER 0, // RIDE_TYPE_INVERTED_ROLLER_COASTER diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index c28ea17046..fbe1af816a 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -260,6 +260,7 @@ void track_paint_util_diag_tiles_paint(sint8 thickness, sint16 height, int direc typedef void (*TRACK_PAINT_FUNCTION)(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element* mapElement); typedef TRACK_PAINT_FUNCTION (*TRACK_PAINT_FUNCTION_GETTER)(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_spiral_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_junior_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_monorail(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_boat_ride(int trackType, int direction); From 8b6f775cffa4c62ac04216b3c3eac4eb6d318152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:19:14 +0200 Subject: [PATCH 03/55] Add generated Stand up RC --- src/ride/coaster/stand_up_roller_coaster.c | 5893 ++++++++++++++++++++ src/ride/track_data.c | 4 +- src/ride/track_paint.h | 1 + 3 files changed, 5896 insertions(+), 2 deletions(-) diff --git a/src/ride/coaster/stand_up_roller_coaster.c b/src/ride/coaster/stand_up_roller_coaster.c index 846fd9695d..3dc6aa12b3 100644 --- a/src/ride/coaster/stand_up_roller_coaster.c +++ b/src/ride/coaster/stand_up_roller_coaster.c @@ -13,3 +13,5896 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void stand_up_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25383, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25384, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25453, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25454, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25229, 0, 6, 32, 20, 3, height); + break; + case 1: + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25230, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void stand_up_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25385, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25397, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25389, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25399, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25231, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25243, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25235, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25245, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void stand_up_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25386, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25398, 0, 6, 1, 10, 75, height, 29, 10, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25390, 0, 6, 1, 10, 75, height, 29, 10, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25400, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25232, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25244, 0, 6, 1, 10, 75, height, 29, 10, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25236, 0, 6, 1, 10, 75, height, 29, 10, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25246, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void stand_up_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25387, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25401, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25391, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25403, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25233, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25247, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25237, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25249, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void stand_up_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25388, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25411, 0, 6, 32, 10, 43, height, 0, 10, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25402, 0, 6, 32, 2, 43, height, 0, 4, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25409, 0, 6, 32, 10, 43, height, 0, 10, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25392, 0, 6, 32, 2, 43, height, 0, 4, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25404, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25234, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25277, 0, 6, 32, 10, 43, height, 0, 10, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25248, 0, 6, 32, 2, 43, height, 0, 4, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25275, 0, 6, 32, 10, 43, height, 0, 10, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25238, 0, 6, 32, 2, 43, height, 0, 4, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25250, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void stand_up_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25396, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25412, 0, 6, 32, 10, 43, height, 0, 10, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25408, 0, 6, 32, 2, 43, height, 0, 4, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25410, 0, 6, 32, 10, 43, height, 0, 10, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25394, 0, 6, 32, 2, 43, height, 0, 4, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25406, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25242, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25278, 0, 6, 32, 10, 43, height, 0, 10, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25254, 0, 6, 32, 2, 43, height, 0, 4, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25276, 0, 6, 32, 10, 43, height, 0, 10, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25240, 0, 6, 32, 2, 43, height, 0, 4, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25252, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void stand_up_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25395, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25407, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25393, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25405, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25241, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25253, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25239, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25251, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void stand_up_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + stand_up_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void stand_up_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + stand_up_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void stand_up_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + stand_up_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void stand_up_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + stand_up_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void stand_up_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + stand_up_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void stand_up_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + stand_up_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void stand_up_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25264, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25269, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25274, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25259, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25263, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25268, 0, 0, 32, 16, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25273, 0, 16, 32, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25258, 0, 16, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25262, 0, 16, 16, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25267, 16, 16, 16, 16, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25272, 16, 0, 16, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25257, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25261, 16, 0, 16, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25266, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25271, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25256, 16, 0, 16, 32, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25260, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25265, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25270, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25255, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + stand_up_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void stand_up_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25281, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25286, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25280, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25283, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void stand_up_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25279, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25284, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25282, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25285, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void stand_up_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25282, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25285, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25279, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25284, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void stand_up_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25280, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25283, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25281, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25286, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void stand_up_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25464, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25475, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25469, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25474, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25459, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25463, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25468, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25473, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25458, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25462, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25467, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25472, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25457, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25461, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25466, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25471, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25456, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25460, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25465, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25470, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25476, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25455, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + stand_up_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void stand_up_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25315, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25316, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25317, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25318, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void stand_up_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25319, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25320, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25321, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25322, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void stand_up_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25311, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25312, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25313, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25314, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void stand_up_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25307, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25308, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25309, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25310, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void stand_up_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + stand_up_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void stand_up_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + stand_up_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void stand_up_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + stand_up_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void stand_up_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + stand_up_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void stand_up_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25323, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25324, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25325, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25326, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void stand_up_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + stand_up_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void stand_up_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25433, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25438, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25443, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25448, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25347, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25352, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25357, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25362, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25434, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25439, 0, 0, 32, 16, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25444, 0, 16, 32, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25449, 0, 16, 32, 16, 3, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25348, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25353, 0, 0, 32, 16, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25358, 0, 16, 32, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25363, 0, 16, 32, 16, 3, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25435, 0, 16, 16, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25440, 16, 16, 16, 16, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25445, 16, 0, 16, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25450, 0, 0, 16, 16, 3, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25349, 0, 16, 16, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25354, 16, 16, 16, 16, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25359, 16, 0, 16, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25364, 0, 0, 16, 16, 3, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25436, 16, 0, 16, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25441, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25446, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25451, 16, 0, 16, 32, 3, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25350, 16, 0, 16, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25355, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25360, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25365, 16, 0, 16, 32, 3, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25437, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25442, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25447, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25452, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25351, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25356, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25361, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25366, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void stand_up_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25413, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25418, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25423, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25428, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25327, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25332, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25337, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25342, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25414, 0, 16, 32, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25419, 0, 16, 32, 16, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25424, 0, 0, 32, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25429, 0, 0, 32, 16, 3, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25328, 0, 16, 32, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25333, 0, 16, 32, 16, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25338, 0, 0, 32, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25343, 0, 0, 32, 16, 3, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25415, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25420, 16, 0, 16, 16, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25425, 16, 16, 16, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25430, 0, 16, 16, 16, 3, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25329, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25334, 16, 0, 16, 16, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25339, 16, 16, 16, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25344, 0, 16, 16, 16, 3, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25416, 16, 0, 16, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25421, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25426, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25431, 16, 0, 16, 32, 3, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25330, 16, 0, 16, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25335, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25340, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25345, 16, 0, 16, 32, 3, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25417, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25422, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25427, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25432, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25331, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25336, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25341, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25346, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void stand_up_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + stand_up_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void stand_up_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + stand_up_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void stand_up_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25371, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25378, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25374, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25375, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25372, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25377, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25373, 0, 6, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25376, 0, 6, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25373, 0, 6, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25376, 0, 6, 32, 26, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25372, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25377, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25374, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25375, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25371, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25378, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25367, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25382, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25370, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25379, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25368, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25381, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25369, 0, 0, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25380, 0, 0, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25369, 0, 0, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25380, 0, 0, 32, 26, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25368, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25381, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25370, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25379, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25367, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25382, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_left_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25477, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25485, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25484, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25492, 0, 6, 32, 20, 7, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25478, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25486, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(0, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25483, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25491, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25479, 16, 0, 5, 16, 119, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25487, 12, 0, 3, 16, 119, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25482, 10, 16, 4, 16, 119, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25490, 16, 16, 4, 16, 119, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25480, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25488, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25481, 0, 16, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25489, 0, 16, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25481, 0, 16, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25489, 0, 16, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25480, 0, 0, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25488, 0, 0, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25482, 10, 16, 4, 16, 119, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25490, 16, 16, 4, 16, 119, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25479, 16, 0, 5, 16, 119, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25487, 12, 0, 3, 16, 119, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25483, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25491, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25478, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25486, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(0, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25484, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25492, 0, 6, 32, 20, 7, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25477, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25485, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void stand_up_rc_track_right_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25508, 0, 6, 32, 20, 7, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25500, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25501, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25493, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25507, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25499, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25502, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(0, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25494, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25506, 16, 16, 4, 16, 119, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25498, 10, 16, 4, 16, 119, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25503, 12, 0, 3, 16, 119, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25495, 16, 0, 5, 16, 119, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25505, 0, 16, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25497, 0, 16, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25504, 0, 0, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25496, 0, 0, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25504, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25496, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25505, 0, 16, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25497, 0, 16, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25503, 12, 0, 3, 16, 119, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25495, 16, 0, 5, 16, 119, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25506, 16, 16, 4, 16, 119, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25498, 10, 16, 4, 16, 119, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25502, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(0, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25494, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25507, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25499, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25501, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25493, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25508, 0, 6, 32, 20, 7, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25500, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void stand_up_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25514, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25517, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25520, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25511, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25513, 16, 0, 16, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25516, 0, 0, 16, 16, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25519, 0, 16, 16, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25510, 16, 16, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25512, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25515, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25518, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25509, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + stand_up_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void stand_up_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25526, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25533, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25529, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25532, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25523, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25525, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25528, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25531, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25522, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25524, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25527, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25530, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25534, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25521, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + stand_up_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void stand_up_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25562, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25564, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25566, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25560, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25546, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25548, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25550, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25544, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25561, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25563, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25565, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25559, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25545, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25547, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25549, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25543, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void stand_up_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25551, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25553, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25555, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25557, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25535, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25537, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25539, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25541, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25552, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25554, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25556, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25558, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25536, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25538, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25540, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25542, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void stand_up_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + stand_up_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void stand_up_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + stand_up_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void stand_up_rc_track_half_loop_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25575, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25583, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25582, 0, 6, 32, 20, 9, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25590, 0, 6, 32, 20, 7, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25576, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25584, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(0, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25581, 0, 6, 32, 2, 3, height, 0, 20, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25589, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25577, 16, 0, 2, 16, 119, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25585, 12, 0, 3, 16, 119, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25580, 10, 16, 4, 12, 119, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25588, 16, 16, 2, 16, 119, height, 15, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25578, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25586, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25579, 0, 16, 32, 12, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25587, 0, 16, 32, 12, 3, height + 32); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void stand_up_rc_track_half_loop_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + stand_up_rc_track_half_loop_up(rideIndex, 3 - trackSequence, direction, height, mapElement); +} + +static void stand_up_rc_track_left_corkscrew_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25591, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25594, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25597, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25600, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25592, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25595, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25598, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25601, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25593, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25596, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25599, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25602, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 35, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void stand_up_rc_track_right_corkscrew_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25603, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25606, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25609, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25612, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25604, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25607, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25610, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25613, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25605, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25608, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25611, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25614, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 35, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void stand_up_rc_track_left_corkscrew_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + stand_up_rc_track_right_corkscrew_up(rideIndex, 2 - trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void stand_up_rc_track_right_corkscrew_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + stand_up_rc_track_left_corkscrew_up(rideIndex, 2 - trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void stand_up_rc_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25844, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25851, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25847, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25850, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25841, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25843, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25846, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25849, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25840, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25842, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25845, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25848, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25852, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25839, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25841, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25844, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25851, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25847, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25850, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25840, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25843, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25846, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25849, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25839, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25842, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25845, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25848, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25852, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25825, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25828, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25831, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25834, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25838, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25826, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25829, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25832, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25835, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25827, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25830, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25837, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25833, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25836, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25828, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25831, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25834, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25838, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25825, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25829, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25832, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25835, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25826, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25830, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25837, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25833, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25836, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25827, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + stand_up_rc_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void stand_up_rc_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + stand_up_rc_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void stand_up_rc_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25812, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25823, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25817, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25822, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25807, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25811, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25816, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25821, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25806, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25810, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25815, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25820, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25805, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25809, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25814, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25819, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25804, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25808, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25813, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25818, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25824, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25803, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25807, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25812, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25823, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25817, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25822, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25806, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25811, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25816, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25821, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25805, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25810, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25815, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25820, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25804, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25809, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25814, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25819, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25803, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25808, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25813, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25818, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25824, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25781, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25786, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25791, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25796, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25802, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25782, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25787, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25792, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25797, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25783, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25788, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25793, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25798, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25784, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25789, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25794, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25799, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25785, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25790, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25801, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25795, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25800, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25786, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25791, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25796, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25802, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25781, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25787, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25792, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25797, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25782, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25788, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25793, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25798, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25783, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25789, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25794, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25799, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25784, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25790, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25801, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25795, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25800, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25785, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + stand_up_rc_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void stand_up_rc_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + stand_up_rc_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void stand_up_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25569, 0, 6, 32, 20, 3, height); + break; + case 1: + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25570, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void stand_up_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, 0x20000000 | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25229, 0, 6, 32, 20, 1, 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(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25230, 0, 6, 32, 20, 1, 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(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25229, 0, 6, 32, 20, 1, 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(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25230, 0, 6, 32, 20, 1, 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); + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void stand_up_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25643, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25647, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25651, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25655, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25644, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25648, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25652, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25656, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25645, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25649, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25653, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25657, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25646, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25650, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25654, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25658, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25627, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25631, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25635, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25639, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25628, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25632, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25636, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25640, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25629, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25633, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25637, 0, 0, 28, 28, 3, height, 4, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25641, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25630, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25634, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25638, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25642, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + stand_up_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void stand_up_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + stand_up_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void stand_up_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25675, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25679, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25683, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25687, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25676, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25680, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25684, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25688, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25677, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25681, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25685, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25689, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25678, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25682, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25686, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25690, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25659, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25663, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25667, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25671, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25660, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25664, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25668, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25672, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25661, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25665, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25669, 0, 0, 28, 28, 0, height, 4, 4, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25673, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25662, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25666, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25670, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25674, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + stand_up_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void stand_up_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + stand_up_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void stand_up_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25756, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25694, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25753, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25691, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25755, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25693, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25754, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25692, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25768, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25706, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25765, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25703, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25767, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25705, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25766, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25704, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25780, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25718, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25777, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25715, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25779, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25717, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25778, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25716, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25760, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25698, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25757, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25695, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25759, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25697, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25758, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25696, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25772, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25710, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25769, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25707, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25771, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25709, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25770, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25708, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25776, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25714, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25773, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25711, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25775, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25713, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25774, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(0, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25712, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(0, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25764, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25702, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25761, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25699, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25763, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25701, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25762, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25700, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25766, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25704, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25767, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25705, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25765, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25703, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25768, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25706, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25778, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25716, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25779, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25717, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25777, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25715, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25780, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25718, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25762, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25700, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25763, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25701, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25761, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25699, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25764, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25702, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25774, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25712, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25775, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25713, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25773, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25711, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25776, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25714, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25770, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25708, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25771, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25709, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25769, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25707, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25772, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25710, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25758, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25696, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25759, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25697, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25757, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25695, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25760, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25698, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25726, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25723, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25727, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25725, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25724, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25731, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25728, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25730, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25732, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25729, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25729, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25730, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25732, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25728, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25731, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25724, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25725, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25723, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25727, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25726, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25746, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25743, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25747, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25745, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25744, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25751, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25748, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25750, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25752, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25749, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25736, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25733, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25737, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25735, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25734, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25741, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25738, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25740, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25742, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25739, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25739, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25740, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25742, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25738, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25741, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25734, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25735, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16676, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16680, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25736, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25749, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25750, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25752, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25748, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25751, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25744, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25745, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25743, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25747, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25746, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25722, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25719, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25721, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25720, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25720, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25721, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25719, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25722, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void stand_up_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25571, 0, 6, 32, 20, 3, height); + break; + case 1: + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25572, 0, 6, 32, 20, 3, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_stand_up_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return stand_up_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return stand_up_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return stand_up_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return stand_up_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return stand_up_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return stand_up_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return stand_up_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return stand_up_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return stand_up_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return stand_up_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return stand_up_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return stand_up_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return stand_up_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return stand_up_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return stand_up_rc_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return stand_up_rc_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return stand_up_rc_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return stand_up_rc_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return stand_up_rc_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return stand_up_rc_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return stand_up_rc_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return stand_up_rc_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return stand_up_rc_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return stand_up_rc_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return stand_up_rc_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return stand_up_rc_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return stand_up_rc_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return stand_up_rc_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return stand_up_rc_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return stand_up_rc_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return stand_up_rc_track_right_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: + return stand_up_rc_track_left_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: + return stand_up_rc_track_right_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return stand_up_rc_track_left_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return stand_up_rc_track_right_quarter_turn_5_25_deg_down; + case TRACK_ELEM_S_BEND_LEFT: + return stand_up_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return stand_up_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_VERTICAL_LOOP: + return stand_up_rc_track_left_vertical_loop; + case TRACK_ELEM_RIGHT_VERTICAL_LOOP: + return stand_up_rc_track_right_vertical_loop; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return stand_up_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return stand_up_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return stand_up_rc_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return stand_up_rc_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return stand_up_rc_track_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return stand_up_rc_track_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return stand_up_rc_track_left_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return stand_up_rc_track_right_quarter_turn_3_25_deg_down; + case TRACK_ELEM_HALF_LOOP_UP: + return stand_up_rc_track_half_loop_up; + case TRACK_ELEM_HALF_LOOP_DOWN: + return stand_up_rc_track_half_loop_down; + case TRACK_ELEM_LEFT_CORKSCREW_UP: + return stand_up_rc_track_left_corkscrew_up; + case TRACK_ELEM_RIGHT_CORKSCREW_UP: + return stand_up_rc_track_right_corkscrew_up; + case TRACK_ELEM_LEFT_CORKSCREW_DOWN: + return stand_up_rc_track_left_corkscrew_down; + case TRACK_ELEM_RIGHT_CORKSCREW_DOWN: + return stand_up_rc_track_right_corkscrew_down; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: + return stand_up_rc_track_left_half_banked_helix_up_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: + return stand_up_rc_track_right_half_banked_helix_up_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: + return stand_up_rc_track_left_half_banked_helix_down_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: + return stand_up_rc_track_right_half_banked_helix_down_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: + return stand_up_rc_track_left_half_banked_helix_up_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: + return stand_up_rc_track_right_half_banked_helix_up_large; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: + return stand_up_rc_track_left_half_banked_helix_down_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: + return stand_up_rc_track_right_half_banked_helix_down_large; + case TRACK_ELEM_BRAKES: + return stand_up_rc_track_brakes; + case TRACK_ELEM_ON_RIDE_PHOTO: + return stand_up_rc_track_on_ride_photo; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return stand_up_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return stand_up_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return stand_up_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return stand_up_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + return stand_up_rc_track_left_eighth_bank_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + return stand_up_rc_track_right_eighth_bank_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + return stand_up_rc_track_left_eighth_bank_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + return stand_up_rc_track_right_eighth_bank_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return stand_up_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return stand_up_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP: + return stand_up_rc_track_diag_60_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return stand_up_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + return stand_up_rc_track_diag_25_deg_up_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + return stand_up_rc_track_diag_60_deg_up_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return stand_up_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return stand_up_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN: + return stand_up_rc_track_diag_60_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return stand_up_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + return stand_up_rc_track_diag_25_deg_down_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + return stand_up_rc_track_diag_60_deg_down_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return stand_up_rc_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + return stand_up_rc_track_diag_flat_to_left_bank; + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + return stand_up_rc_track_diag_flat_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + return stand_up_rc_track_diag_left_bank_to_flat; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + return stand_up_rc_track_diag_right_bank_to_flat; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + return stand_up_rc_track_diag_left_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + return stand_up_rc_track_diag_right_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + return stand_up_rc_track_diag_25_deg_up_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + return stand_up_rc_track_diag_25_deg_up_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + return stand_up_rc_track_diag_left_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + return stand_up_rc_track_diag_right_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + return stand_up_rc_track_diag_25_deg_down_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + return stand_up_rc_track_diag_25_deg_down_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK: + return stand_up_rc_track_diag_left_bank; + case TRACK_ELEM_DIAG_RIGHT_BANK: + return stand_up_rc_track_diag_right_bank; + case TRACK_ELEM_BLOCK_BRAKES: + return stand_up_rc_track_block_brakes; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 53382369cd..1142ac50c5 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6241,8 +6241,8 @@ const track_curve_chain gFlatRideTrackCurveChain[256] = { }; const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { - get_track_paint_function_spiral_rc, // RIDE_TYPE_SPIRAL_ROLLER_COASTER - 0, // RIDE_TYPE_STAND_UP_ROLLER_COASTER + get_track_paint_function_spiral_rc, // RIDE_TYPE_SPIRAL_ROLLER_COASTER + get_track_paint_function_stand_up_rc, // RIDE_TYPE_STAND_UP_ROLLER_COASTER 0, // RIDE_TYPE_SUSPENDED_SWINGING_COASTER 0, // RIDE_TYPE_INVERTED_ROLLER_COASTER get_track_paint_function_junior_rc, // RIDE_TYPE_JUNIOR_ROLLER_COASTER diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index fbe1af816a..d91794de71 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -261,6 +261,7 @@ typedef void (*TRACK_PAINT_FUNCTION)(uint8 rideIndex, uint8 trackSequence, uint8 typedef TRACK_PAINT_FUNCTION (*TRACK_PAINT_FUNCTION_GETTER)(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_spiral_rc(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_stand_up_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_junior_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_monorail(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_boat_ride(int trackType, int direction); From 9e946bce8eae5c4a2af4b7d6b0ec25c075f500e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:20:04 +0200 Subject: [PATCH 04/55] Add generated Suspended swinging RC --- src/ride/coaster/suspended_swinging_coaster.c | 2926 +++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 2928 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/suspended_swinging_coaster.c b/src/ride/coaster/suspended_swinging_coaster.c index 846fd9695d..b4e658afc2 100644 --- a/src/ride/coaster/suspended_swinging_coaster.c +++ b/src/ride/coaster/suspended_swinging_coaster.c @@ -13,3 +13,2929 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void suspended_swinging_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25963, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25964, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25961, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25962, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void suspended_swinging_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26001, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 6, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26002, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 8, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26003, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 7, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26004, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 5, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25973, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 6, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25974, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 8, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25975, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 7, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25976, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 5, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void suspended_swinging_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25989, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 93); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25990, 0, 0, 32, 2, 81, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25991, 0, 0, 32, 2, 81, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25992, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 93); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); +} + +static void suspended_swinging_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25993, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 6, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25994, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 8, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25995, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 7, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25996, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 5, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25965, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 6, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25966, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 8, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25967, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 7, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25968, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 5, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void suspended_swinging_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25977, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25981, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25978, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25982, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25979, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25980, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); +} + +static void suspended_swinging_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25983, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 6, 0, height + 76, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25987, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26090, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 8, 0, height + 76, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25988, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25985, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 7, 0, height + 76, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25986, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 5, 0, height + 76, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25983, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 6, 0, height + 76, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25987, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25984, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 8, 0, height + 76, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25988, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25985, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 7, 0, height + 76, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25986, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 5, 0, height + 76, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); +} + +static void suspended_swinging_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25997, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 6, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25998, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 8, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25999, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 7, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26000, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 5, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25969, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 6, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25970, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 8, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25971, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 7, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25972, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 5, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_13); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void suspended_swinging_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + suspended_swinging_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void suspended_swinging_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + suspended_swinging_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void suspended_swinging_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + suspended_swinging_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void suspended_swinging_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + suspended_swinging_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void suspended_swinging_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + suspended_swinging_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void suspended_swinging_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + suspended_swinging_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void suspended_swinging_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26014, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26019, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26024, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26009, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26013, 0, 0, 32, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26018, 0, 0, 32, 16, 3, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26023, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26008, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26012, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26017, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26022, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26007, 0, 0, 16, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26011, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26016, 0, 0, 16, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26021, 0, 0, 16, 32, 3, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26006, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26010, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26015, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26020, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26005, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + suspended_swinging_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void suspended_swinging_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26097, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26102, 0, 6, 32, 20, 11, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26107, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26112, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26098, 0, 0, 32, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26103, 0, 0, 32, 16, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26108, 0, 16, 32, 16, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26113, 0, 16, 32, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26099, 0, 16, 16, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26104, 16, 16, 16, 16, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26109, 16, 0, 16, 16, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26114, 0, 0, 16, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26100, 16, 0, 16, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26105, 0, 0, 16, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26110, 0, 0, 16, 32, 3, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26115, 16, 0, 16, 32, 3, height + 29, 16, 0, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26101, 6, 0, 20, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26106, 6, 0, 20, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26111, 6, 0, 20, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26116, 6, 0, 20, 32, 3, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_5); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26077, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26082, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26087, 0, 6, 32, 20, 11, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26092, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26078, 0, 16, 32, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26083, 0, 16, 32, 16, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26088, 0, 0, 32, 16, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26093, 0, 0, 32, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26079, 0, 0, 16, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26084, 16, 0, 16, 16, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26089, 16, 16, 16, 16, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26094, 0, 16, 16, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26080, 16, 0, 16, 32, 3, height + 29, 16, 0, height + 37); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26085, 0, 0, 16, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26090, 0, 0, 16, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26095, 16, 0, 16, 32, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26081, 6, 0, 20, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26086, 6, 0, 20, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26091, 6, 0, 20, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26096, 6, 0, 20, 32, 3, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_5); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + suspended_swinging_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void suspended_swinging_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + suspended_swinging_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void suspended_swinging_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26139, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26146, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26142, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26143, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26140, 0, 0, 32, 26, 3, height + 29); + metal_a_supports_paint_setup(0, 5, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26145, 0, 0, 32, 26, 3, height + 29); + metal_a_supports_paint_setup(0, 6, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26141, 0, 6, 32, 26, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26144, 0, 6, 32, 26, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26141, 0, 6, 32, 26, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26144, 0, 6, 32, 26, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26140, 0, 0, 32, 26, 3, height + 29); + metal_a_supports_paint_setup(0, 5, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26145, 0, 0, 32, 26, 3, height + 29); + metal_a_supports_paint_setup(0, 6, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26142, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26143, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26139, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26146, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26135, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26150, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26138, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26147, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26136, 0, 6, 32, 26, 3, height + 29); + metal_a_supports_paint_setup(0, 8, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26149, 0, 6, 32, 26, 3, height + 29); + metal_a_supports_paint_setup(0, 7, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26137, 0, 0, 32, 26, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26148, 0, 0, 32, 26, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26137, 0, 0, 32, 26, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26148, 0, 0, 32, 26, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26136, 0, 6, 32, 26, 3, height + 29); + metal_a_supports_paint_setup(0, 8, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26149, 0, 6, 32, 26, 3, height + 29); + metal_a_supports_paint_setup(0, 7, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26138, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26147, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26135, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26150, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26070, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26073, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26076, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26067, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26069, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26072, 0, 0, 16, 16, 3, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26075, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26066, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26068, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26071, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26074, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26065, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + suspended_swinging_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void suspended_swinging_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26130, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26132, 0, 6, 32, 20, 11, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26134, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26128, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26129, 6, 0, 20, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26131, 6, 0, 20, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26133, 6, 0, 20, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26127, 6, 0, 20, 32, 3, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_5); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26119, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26121, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26123, 0, 6, 32, 20, 11, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26125, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26120, 6, 0, 20, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26122, 6, 0, 20, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26124, 6, 0, 20, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26126, 6, 0, 20, 32, 3, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_5); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + suspended_swinging_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void suspended_swinging_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + suspended_swinging_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void suspended_swinging_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26117, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26118, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void suspended_swinging_rc_track_left_quarter_helix_large_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26054, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26059, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26064, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26049, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26053, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26058, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26063, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26048, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26052, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26057, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26062, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26047, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26051, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26056, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26061, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26046, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26050, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26055, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26060, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26045, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 58, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 16, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height + 16, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_right_quarter_helix_large_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26025, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26030, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26035, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26040, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26026, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26031, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26036, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26041, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26027, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26032, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26037, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26042, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26028, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26033, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26038, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26043, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26029, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26034, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26039, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26044, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 58, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 16, TUNNEL_3); + break; + case 1: + paint_util_push_tunnel_left(height + 16, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_left_quarter_helix_large_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26034, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26039, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26044, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26029, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 58, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 16, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26033, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26038, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26043, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26028, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26032, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26037, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26042, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26027, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26031, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26036, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26041, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26026, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26030, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26035, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26040, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26025, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_right_quarter_helix_large_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26045, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26050, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26055, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26060, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 58, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 16, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26046, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26051, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26056, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26061, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26047, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26052, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26057, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26062, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26048, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26053, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26058, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26063, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26049, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26054, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26059, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26064, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26167, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26171, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26175, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26179, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26168, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26172, 0, 0, 34, 16, 3, height + 29, 0, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26176, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26180, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26169, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26173, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26177, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26181, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26170, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + metal_a_supports_paint_setup(0, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26174, 0, 0, 16, 18, 3, height + 29, 0, 16, height + 29); + metal_a_supports_paint_setup(0, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26178, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + metal_a_supports_paint_setup(0, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26182, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + metal_a_supports_paint_setup(0, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26151, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26155, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26159, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26163, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26152, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26156, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26160, 0, 0, 34, 16, 3, height + 29, 0, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26164, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26153, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26157, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26161, 0, 0, 28, 28, 3, height + 29, 4, 4, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26165, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26154, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + metal_a_supports_paint_setup(0, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26158, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + metal_a_supports_paint_setup(0, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26162, 0, 0, 16, 18, 3, height + 29, 0, 16, height + 29); + metal_a_supports_paint_setup(0, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26166, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + metal_a_supports_paint_setup(0, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + suspended_swinging_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void suspended_swinging_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + suspended_swinging_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void suspended_swinging_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26214, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26186, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26211, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26183, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26213, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26185, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26212, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(0, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26184, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(0, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26226, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26198, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26223, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26195, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26225, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26197, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26224, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + metal_a_supports_paint_setup(0, 0, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26196, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + metal_a_supports_paint_setup(0, 0, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26210, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26207, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26209, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 32, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26208, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_b_supports_paint_setup(0, 0, 36, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 32, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 36, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26218, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26190, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26215, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26187, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26217, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26189, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26216, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(0, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26188, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(0, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26202, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26199, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26201, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 16, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26200, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + metal_b_supports_paint_setup(0, 0, 16, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 16, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 16, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26206, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26203, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26205, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 21, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26204, -16, -16, 16, 16, 3, height + 29, 0, 0, height + 61); + metal_b_supports_paint_setup(0, 0, 21, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 21, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 21, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26222, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26194, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26219, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26191, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26221, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26193, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26220, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(0, 0, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26192, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(0, 0, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26224, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26196, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26225, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26197, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26223, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26195, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26226, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + metal_a_supports_paint_setup(0, 0, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26198, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + metal_a_supports_paint_setup(0, 0, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26208, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26209, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26207, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26210, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26220, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26192, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26221, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26193, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26219, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26191, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26222, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(0, 0, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26194, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(0, 0, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26204, -16, -16, 16, 16, 3, height + 29, 0, 0, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26205, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26203, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 17, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26206, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + metal_b_supports_paint_setup(0, 0, 17, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 17, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 17, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26200, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26201, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26199, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26202, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + metal_b_supports_paint_setup(0, 0, 8, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26216, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26188, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26217, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26189, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26215, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26187, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26218, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(0, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26190, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(0, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void suspended_swinging_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26117, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26118, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_suspended_swinging_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return suspended_swinging_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return suspended_swinging_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return suspended_swinging_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return suspended_swinging_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return suspended_swinging_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return suspended_swinging_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return suspended_swinging_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return suspended_swinging_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return suspended_swinging_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return suspended_swinging_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return suspended_swinging_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return suspended_swinging_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return suspended_swinging_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return suspended_swinging_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return suspended_swinging_rc_track_right_quarter_turn_5; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: + return suspended_swinging_rc_track_left_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: + return suspended_swinging_rc_track_right_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return suspended_swinging_rc_track_left_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return suspended_swinging_rc_track_right_quarter_turn_5_25_deg_down; + case TRACK_ELEM_S_BEND_LEFT: + return suspended_swinging_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return suspended_swinging_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return suspended_swinging_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return suspended_swinging_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return suspended_swinging_rc_track_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return suspended_swinging_rc_track_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return suspended_swinging_rc_track_left_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return suspended_swinging_rc_track_right_quarter_turn_3_25_deg_down; + case TRACK_ELEM_BRAKES: + return suspended_swinging_rc_track_brakes; + case TRACK_ELEM_LEFT_QUARTER_HELIX_LARGE_UP: + return suspended_swinging_rc_track_left_quarter_helix_large_up; + case TRACK_ELEM_RIGHT_QUARTER_HELIX_LARGE_UP: + return suspended_swinging_rc_track_right_quarter_helix_large_up; + case TRACK_ELEM_LEFT_QUARTER_HELIX_LARGE_DOWN: + return suspended_swinging_rc_track_left_quarter_helix_large_down; + case TRACK_ELEM_RIGHT_QUARTER_HELIX_LARGE_DOWN: + return suspended_swinging_rc_track_right_quarter_helix_large_down; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return suspended_swinging_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return suspended_swinging_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return suspended_swinging_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return suspended_swinging_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return suspended_swinging_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return suspended_swinging_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP: + return suspended_swinging_rc_track_diag_60_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return suspended_swinging_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + return suspended_swinging_rc_track_diag_25_deg_up_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + return suspended_swinging_rc_track_diag_60_deg_up_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return suspended_swinging_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return suspended_swinging_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN: + return suspended_swinging_rc_track_diag_60_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return suspended_swinging_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + return suspended_swinging_rc_track_diag_25_deg_down_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + return suspended_swinging_rc_track_diag_60_deg_down_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return suspended_swinging_rc_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_BLOCK_BRAKES: + return suspended_swinging_rc_track_block_brakes; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 1142ac50c5..3042363fe3 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6243,7 +6243,7 @@ const track_curve_chain gFlatRideTrackCurveChain[256] = { const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_spiral_rc, // RIDE_TYPE_SPIRAL_ROLLER_COASTER get_track_paint_function_stand_up_rc, // RIDE_TYPE_STAND_UP_ROLLER_COASTER - 0, // RIDE_TYPE_SUSPENDED_SWINGING_COASTER + get_track_paint_function_suspended_swinging_rc, // RIDE_TYPE_SUSPENDED_SWINGING_COASTER 0, // RIDE_TYPE_INVERTED_ROLLER_COASTER get_track_paint_function_junior_rc, // RIDE_TYPE_JUNIOR_ROLLER_COASTER 0, // RIDE_TYPE_MINIATURE_RAILWAY diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index d91794de71..d1c89e00ba 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -262,6 +262,7 @@ typedef TRACK_PAINT_FUNCTION (*TRACK_PAINT_FUNCTION_GETTER)(int trackType, int d TRACK_PAINT_FUNCTION get_track_paint_function_spiral_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_stand_up_rc(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_suspended_swinging_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_junior_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_monorail(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_boat_ride(int trackType, int direction); From 208fa6968c4a03583a5aa781ea22406dd34b98dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:23:34 +0200 Subject: [PATCH 05/55] Add generated Inverted RC --- src/ride/coaster/inverted_roller_coaster.c | 6777 ++++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 6779 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/inverted_roller_coaster.c b/src/ride/coaster/inverted_roller_coaster.c index 846fd9695d..86191dbd52 100644 --- a/src/ride/coaster/inverted_roller_coaster.c +++ b/src/ride/coaster/inverted_roller_coaster.c @@ -13,3 +13,6780 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void inverted_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27131, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27132, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27129, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27130, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void inverted_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27249, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27250, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27251, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27252, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27221, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27222, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27223, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27224, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void inverted_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27237, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 93); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27238, 0, 0, 32, 2, 81, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27239, 0, 0, 32, 2, 81, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27240, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 93); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); +} + +static void inverted_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27241, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27242, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27243, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27244, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27213, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27214, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27215, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27216, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void inverted_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27225, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27229, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27226, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27230, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27227, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27228, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); +} + +static void inverted_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27231, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 76, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27235, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27232, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 76, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27236, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27233, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 76, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27234, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 76, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); +} + +static void inverted_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27245, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27246, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27247, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27248, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27217, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27218, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27219, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27220, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_13); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void inverted_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27142, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27147, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27152, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27137, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27141, 0, 0, 32, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27146, 0, 0, 32, 16, 3, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27151, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27136, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27140, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27145, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27150, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27135, 0, 0, 16, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27139, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27144, 0, 0, 16, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27149, 0, 0, 16, 32, 3, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27134, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27138, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27143, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27148, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27133, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + inverted_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void inverted_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27269, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27270, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27271, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27272, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void inverted_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27273, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27274, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27275, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27276, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void inverted_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27275, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27276, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27273, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27274, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void inverted_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27271, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27272, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27269, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27270, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void inverted_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27162, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27167, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27172, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27157, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27161, 0, 0, 32, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27166, 0, 0, 32, 16, 3, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27171, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27156, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27160, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27165, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27170, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27155, 0, 0, 16, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27159, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27164, 0, 0, 16, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27169, 0, 0, 16, 32, 3, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27154, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27158, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27163, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27168, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27153, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + inverted_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void inverted_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27277, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27278, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27279, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27280, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void inverted_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27281, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27282, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27283, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27284, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void inverted_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27285, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27286, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27287, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27288, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_13); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void inverted_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27289, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27290, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27291, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27292, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_13); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void inverted_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27293, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27294, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27295, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27296, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void inverted_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27317, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27322, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27327, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27332, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27318, 0, 0, 32, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27323, 0, 0, 32, 16, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27328, 0, 16, 32, 16, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27333, 0, 16, 32, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27319, 0, 16, 16, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27324, 16, 16, 16, 16, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27329, 16, 0, 16, 16, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27334, 0, 0, 16, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27320, 16, 0, 16, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27325, 0, 0, 16, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27330, 0, 0, 16, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27335, 16, 0, 16, 32, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27321, 6, 0, 20, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27326, 6, 0, 20, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27331, 6, 0, 20, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27336, 6, 0, 20, 32, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_5); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void inverted_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27297, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27302, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27307, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27312, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27298, 0, 16, 32, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27303, 0, 16, 32, 16, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27308, 0, 0, 32, 16, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27313, 0, 0, 32, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27299, 0, 0, 16, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27304, 16, 0, 16, 16, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27309, 16, 16, 16, 16, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27314, 0, 16, 16, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27300, 16, 0, 16, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27305, 0, 0, 16, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27310, 0, 0, 16, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27315, 16, 0, 16, 32, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27301, 6, 0, 20, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27306, 6, 0, 20, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27311, 6, 0, 20, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27316, 6, 0, 20, 32, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_5); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void inverted_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + inverted_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void inverted_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + inverted_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void inverted_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27253, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27257, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27256, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27260, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27254, 0, 0, 32, 26, 3, height + 29); + metal_a_supports_paint_setup(3, 5, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27258, 0, 0, 32, 26, 3, height + 29); + metal_a_supports_paint_setup(3, 6, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27255, 0, 0, 32, 26, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27259, 0, 0, 32, 26, 3, height + 29, 0, 6, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27255, 0, 0, 32, 26, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27259, 0, 0, 32, 26, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27254, 0, 0, 32, 26, 3, height + 29); + metal_a_supports_paint_setup(3, 5, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27258, 0, 0, 32, 26, 3, height + 29); + metal_a_supports_paint_setup(3, 6, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27256, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27260, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27253, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27257, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27261, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27265, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27264, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27268, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27262, 0, 0, 32, 26, 3, height + 29, 0, 6, height + 29); + metal_a_supports_paint_setup(3, 8, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27266, 0, 0, 32, 26, 3, height + 29, 0, 6, height + 29); + metal_a_supports_paint_setup(3, 7, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27263, 0, 0, 32, 26, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27267, 0, 0, 32, 26, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27263, 0, 0, 32, 26, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27267, 0, 0, 32, 26, 3, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27262, 0, 0, 32, 26, 3, height + 29, 0, 6, height + 29); + metal_a_supports_paint_setup(3, 8, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27266, 0, 0, 32, 26, 3, height + 29, 0, 6, height + 29); + metal_a_supports_paint_setup(3, 7, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27264, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27268, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27261, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27265, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_left_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27355, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(3, 6, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27363, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(3, 8, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27362, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(3, 7, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27370, 0, 6, 32, 10, 7, height + 29, 0, 6, height + 45); + metal_a_supports_paint_setup(3, 5, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27356, 0, 0, 32, 2, 3, height + 29, 0, 29, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27364, 0, 14, 32, 2, 63, height + 29, 0, 29, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27361, 0, 6, 32, 2, 3, height + 29, 0, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27369, 0, 6, 2, 2, 3, height + 29, 29, 20, height + 29); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27357, 16, 0, 5, 2, 119, height + 2, 16, 29, height + 2); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27365, 12, 0, 32, 2, 119, height + 2, 0, -6, height + 2); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27360, 10, 16, 4, 2, 119, height + 2, 10, 0, height + 2); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27368, 16, 16, 2, 2, 119, height + 2, 29, 29, height + 2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27358, 0, 0, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27366, 0, 0, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27359, 0, 16, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27367, 0, 16, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27359, 0, 16, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27367, 0, 16, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27358, 0, 0, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27366, 0, 0, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27360, 10, 16, 4, 2, 119, height + 2, 10, 0, height + 2); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27368, 16, 16, 2, 2, 119, height + 2, 29, 29, height + 2); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27357, 16, 0, 5, 2, 119, height + 2, 16, 29, height + 2); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27365, 12, 0, 32, 2, 119, height + 2, 0, -6, height + 2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27361, 0, 6, 32, 2, 3, height + 29, 0, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27369, 0, 6, 2, 2, 3, height + 29, 29, 20, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27356, 0, 0, 32, 2, 3, height + 29, 0, 29, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27364, 0, 14, 32, 2, 63, height + 29, 0, 29, height + 29); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27362, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(3, 7, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27370, 0, 6, 32, 10, 7, height + 29, 0, 6, height + 45); + metal_a_supports_paint_setup(3, 5, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27355, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(3, 6, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27363, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(3, 8, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_4); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_4); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void inverted_rc_track_right_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27386, 0, 6, 32, 10, 7, height + 29, 0, 6, height + 45); + metal_a_supports_paint_setup(3, 6, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27378, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(3, 8, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27379, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(3, 7, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27371, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(3, 5, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27385, 0, 6, 2, 2, 3, height + 29, 29, 20, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27377, 0, 6, 32, 2, 3, height + 29, 0, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27380, 0, 14, 32, 2, 63, height + 29, 0, 29, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27372, 0, 0, 32, 2, 3, height + 29, 0, 29, height + 29); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27384, 16, 16, 2, 2, 119, height + 2, 29, 29, height + 2); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27376, 10, 16, 4, 2, 119, height + 2, 10, 0, height + 2); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27381, 12, 0, 32, 2, 119, height + 2, 0, -6, height + 2); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27373, 16, 0, 5, 2, 119, height + 2, 16, 29, height + 2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27383, 0, 16, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27375, 0, 16, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27382, 0, 0, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27374, 0, 0, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27382, 0, 0, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27374, 0, 0, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27383, 0, 16, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27375, 0, 16, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27381, 12, 0, 32, 2, 119, height + 2, 0, -6, height + 2); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27373, 16, 0, 5, 2, 119, height + 2, 16, 29, height + 2); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27384, 16, 16, 2, 2, 119, height + 2, 29, 29, height + 2); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27376, 10, 16, 4, 2, 119, height + 2, 10, 0, height + 2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27380, 0, 14, 32, 2, 63, height + 29, 0, 29, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27372, 0, 0, 32, 2, 3, height + 29, 0, 29, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27385, 0, 6, 2, 2, 3, height + 29, 29, 20, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27377, 0, 6, 32, 2, 3, height + 29, 0, 0, height + 29); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27379, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(3, 7, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27371, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(3, 5, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27386, 0, 6, 32, 10, 7, height + 29, 0, 6, height + 45); + metal_a_supports_paint_setup(3, 6, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27378, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(3, 8, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_4); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_4); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void inverted_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27392, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27395, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27398, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27389, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27391, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27394, 0, 0, 16, 16, 3, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27397, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27388, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27390, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27393, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27396, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27387, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + inverted_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void inverted_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27404, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27407, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27410, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27401, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27403, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27406, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27409, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27400, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27402, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27405, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27408, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27399, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + inverted_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void inverted_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27422, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27424, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27426, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27420, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27421, 6, 0, 20, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27423, 6, 0, 20, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27425, 6, 0, 20, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27419, 6, 0, 20, 32, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_5); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void inverted_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27411, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27413, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27415, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27417, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27412, 6, 0, 20, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27414, 6, 0, 20, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27416, 6, 0, 20, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27418, 6, 0, 20, 32, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_5); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void inverted_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + inverted_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void inverted_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + inverted_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void inverted_rc_track_left_twist_down_to_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27427, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27433, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27432, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27438, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27428, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27434, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27431, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27437, 0, 6, 32, 20, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27429, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27435, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27430, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27436, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_right_twist_down_to_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27439, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27445, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27444, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27450, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27440, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27446, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27443, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27449, 0, 6, 32, 20, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27441, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27447, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27442, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27448, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_left_twist_up_to_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27430, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27436, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27429, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27435, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27431, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27437, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27428, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27434, 0, 6, 32, 20, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27432, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27438, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27427, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27433, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_right_twist_up_to_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27442, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27448, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27441, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27447, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27443, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27449, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27440, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27446, 0, 6, 32, 20, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27444, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27450, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27439, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27445, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_half_loop_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27451, 0, 6, 32, 20, 3, height + 29, 0, 6, height + 45); + metal_a_supports_paint_setup(3, 6, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27459, 0, 6, 32, 20, 3, height + 29, 0, 6, height + 45); + metal_a_supports_paint_setup(3, 8, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27458, 0, 6, 32, 20, 3, height + 29, 0, 6, height + 45); + metal_a_supports_paint_setup(3, 7, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27466, 0, 6, 32, 20, 3, height + 29, 0, 6, height + 45); + metal_a_supports_paint_setup(3, 5, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27452, 0, 0, 32, 2, 3, height + 29, 0, 29, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27460, 0, 14, 32, 2, 63, height + 29, 0, 29, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27457, 0, 6, 32, 2, 3, height + 29, 0, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27465, 0, 6, 2, 2, 3, height + 29, 29, 20, height + 29); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27453, 16, 0, 5, 2, 119, height + 2, 16, 29, height + 2); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27461, 12, 0, 32, 2, 119, height + 2, 0, -6, height + 2); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27456, 10, 16, 4, 2, 119, height + 2, 10, 0, height + 2); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27464, 16, 16, 2, 2, 119, height + 2, 29, 29, height + 2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27454, 0, 0, 32, 20, 3, height + 34, 0, 6, height + 34); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27462, 0, 0, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27455, 0, 16, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27463, 0, 16, 32, 20, 3, height + 34, 0, 6, height + 34); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 32, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void inverted_rc_track_half_loop_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_half_loop_up(rideIndex, 3 - trackSequence, direction, height, mapElement); +} + +static void inverted_rc_track_left_corkscrew_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27467, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 33); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27470, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 33); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27473, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 33); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27476, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 33); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27468, 0, 0, 20, 20, 3, height + 14, 6, 6, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27471, 0, 0, 20, 20, 3, height + 14, 6, 6, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27474, 0, 0, 20, 20, 3, height + 14, 6, 6, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27477, 0, 0, 20, 20, 3, height + 14, 6, 6, height + 24); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27469, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 39); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27472, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 39); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27475, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 39); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27478, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 39); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 28, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 40, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height + 40, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void inverted_rc_track_right_corkscrew_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27479, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 33); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27482, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 33); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27485, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 33); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27488, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 33); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27480, 0, 0, 20, 20, 3, height + 14, 6, 6, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27483, 0, 0, 20, 20, 3, height + 14, 6, 6, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27486, 0, 0, 20, 20, 3, height + 14, 6, 6, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27489, 0, 0, 20, 20, 3, height + 14, 6, 6, height + 24); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27481, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 39); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27484, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 39); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27487, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 39); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27490, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 39); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 28, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 40, TUNNEL_3); + break; + case 1: + paint_util_push_tunnel_left(height + 40, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void inverted_rc_track_left_corkscrew_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_right_corkscrew_up(rideIndex, 2 - trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void inverted_rc_track_right_corkscrew_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_left_corkscrew_up(rideIndex, 2 - trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void inverted_rc_track_left_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27352, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27348, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27353, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27349, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27354, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27350, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27351, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27347, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_left(height - 8, TUNNEL_5); + break; + case 2: + paint_util_push_tunnel_right(height + 56, TUNNEL_4); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_4); + paint_util_push_tunnel_left(height + 56, TUNNEL_4); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void inverted_rc_track_right_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27343, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27339, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27344, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27340, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27345, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27341, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27346, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27342, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 56, TUNNEL_4); + paint_util_push_tunnel_left(height - 8, TUNNEL_4); + break; + case 1: + paint_util_push_tunnel_left(height + 56, TUNNEL_5); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_4); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void inverted_rc_track_left_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_right_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void inverted_rc_track_right_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_left_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void inverted_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27337, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27338, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void inverted_rc_track_left_quarter_banked_helix_large_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27202, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27207, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27212, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27197, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27201, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27206, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27211, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27196, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27200, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27205, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27210, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27195, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27199, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27204, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27209, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27194, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27198, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27203, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27208, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27193, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 58, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 16, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height + 16, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_right_quarter_banked_helix_large_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27173, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27178, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27183, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27188, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27174, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27179, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27184, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27189, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27175, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27180, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27185, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27190, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27176, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27181, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27186, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27191, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27177, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27182, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27187, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27192, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 58, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 16, TUNNEL_3); + break; + case 1: + paint_util_push_tunnel_left(height + 16, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_left_quarter_banked_helix_large_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27182, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27187, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27192, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27177, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 58, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 16, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27181, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27186, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27191, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27176, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27180, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27185, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27190, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27175, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27179, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27184, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27189, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27174, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27178, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27183, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27188, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27173, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_right_quarter_banked_helix_large_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27193, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27198, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27203, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27208, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 58, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 16, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27194, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27199, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27204, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27209, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27195, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27200, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27205, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27210, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27196, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27201, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27206, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27211, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27197, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27202, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27207, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27212, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_25_deg_up_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27711, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27712, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27713, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27714, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void inverted_rc_track_25_deg_up_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27715, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27716, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27717, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27718, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void inverted_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, 0x20000000 | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(3, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(3, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27129, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + 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(3, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(3, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27130, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + 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(3, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(3, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27129, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + 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(3, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(3, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27130, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + 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); + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void inverted_rc_track_25_deg_down_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_25_deg_up_right_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_25_deg_down_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_25_deg_up_left_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27507, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27511, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27515, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27519, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27508, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27512, 0, 0, 34, 16, 3, height + 29, 0, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27516, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27520, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27509, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27513, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27517, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27521, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27510, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + metal_a_supports_paint_setup(3, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27514, 0, 0, 16, 18, 3, height + 29, 0, 16, height + 29); + metal_a_supports_paint_setup(3, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27518, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + metal_a_supports_paint_setup(3, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27522, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + metal_a_supports_paint_setup(3, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27491, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27495, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27499, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27503, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27492, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27496, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27500, 0, 0, 34, 16, 3, height + 29, 0, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27504, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27493, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27497, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27501, 0, 0, 28, 28, 3, height + 29, 4, 4, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27505, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27494, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + metal_a_supports_paint_setup(3, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27498, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + metal_a_supports_paint_setup(3, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27502, 0, 0, 16, 18, 3, height + 29, 0, 16, height + 29); + metal_a_supports_paint_setup(3, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27506, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + metal_a_supports_paint_setup(3, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + inverted_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + inverted_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void inverted_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27539, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27543, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27547, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27551, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27540, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27544, 0, 0, 34, 16, 3, height + 29, 0, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27548, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27552, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27541, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27545, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27549, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27553, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27542, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + metal_a_supports_paint_setup(3, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27546, 0, 0, 16, 18, 3, height + 29, 0, 16, height + 29); + metal_a_supports_paint_setup(3, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27550, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + metal_a_supports_paint_setup(3, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27554, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + metal_a_supports_paint_setup(3, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27523, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27527, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27531, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27535, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27524, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27528, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27532, 0, 0, 34, 16, 3, height + 29, 0, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27536, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27525, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27529, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27533, 0, 0, 28, 28, 3, height + 29, 4, 4, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27537, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27526, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + metal_a_supports_paint_setup(3, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27530, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + metal_a_supports_paint_setup(3, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27534, 0, 0, 16, 18, 3, height + 29, 0, 16, height + 29); + metal_a_supports_paint_setup(3, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27538, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + metal_a_supports_paint_setup(3, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + inverted_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + inverted_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void inverted_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27614, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27558, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27611, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27555, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27613, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27557, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27612, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(3, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27556, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(3, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27626, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27570, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27623, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27567, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27625, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27569, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27624, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + metal_a_supports_paint_setup(3, 0, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27568, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + metal_a_supports_paint_setup(3, 0, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void inverted_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27582, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27579, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27581, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 32, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27580, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_b_supports_paint_setup(3, 0, 36, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 32, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 36, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + } +} + +static void inverted_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27618, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27562, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27615, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27559, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27617, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27561, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27616, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(3, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27560, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(3, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void inverted_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27574, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27571, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27573, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 16, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27572, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + metal_b_supports_paint_setup(3, 0, 16, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 16, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 16, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void inverted_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27578, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27575, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27577, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 21, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27576, -16, -16, 16, 16, 3, height + 29, 0, 0, height + 61); + metal_b_supports_paint_setup(3, 0, 21, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 21, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 21, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void inverted_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27622, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27566, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27619, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27563, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27621, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27565, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27620, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(3, 0, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27564, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(3, 0, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void inverted_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27624, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27568, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27625, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27569, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27623, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27567, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27626, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + metal_a_supports_paint_setup(3, 0, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27570, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + metal_a_supports_paint_setup(3, 0, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void inverted_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27580, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27581, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27579, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 24, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27582, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + metal_b_supports_paint_setup(3, 0, 28, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 24, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 28, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + } +} + +static void inverted_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27620, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27564, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27621, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27565, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27619, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27563, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27622, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(3, 0, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27566, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(3, 0, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void inverted_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27576, -16, -16, 16, 16, 3, height + 29, 0, 0, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27577, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27575, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 17, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27578, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + metal_b_supports_paint_setup(3, 0, 17, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 17, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 17, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void inverted_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27572, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27573, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27571, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 8, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27574, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + metal_b_supports_paint_setup(3, 0, 8, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 8, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 8, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void inverted_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27616, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27560, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27617, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27561, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27615, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27559, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27618, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(3, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27562, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(3, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void inverted_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27590, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27587, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27589, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27588, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(3, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27594, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27591, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27593, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27592, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(3, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27592, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27593, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27591, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27594, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(3, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27588, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27589, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27587, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27590, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(3, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27606, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27603, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27605, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27604, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(3, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void inverted_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27610, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27607, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27609, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27608, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(3, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void inverted_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27598, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27595, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27597, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27596, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(3, 0, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void inverted_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27602, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27599, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27601, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27600, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(3, 0, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void inverted_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27600, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27601, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27599, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27602, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(3, 0, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void inverted_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27596, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27597, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27595, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27598, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(3, 0, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void inverted_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27608, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27609, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27607, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27610, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(3, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void inverted_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27604, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27605, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27603, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27606, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(3, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void inverted_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27586, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27583, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27585, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27584, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(3, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27584, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27585, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27583, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27586, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(3, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void inverted_rc_track_left_large_half_loop_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27639, 0, 0, 32, 20, 3, height, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27646, 0, 0, 32, 20, 3, height, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27653, 0, 0, 32, 20, 3, height, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27660, 0, 0, 32, 20, 3, height, 0, 6, height + 29); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27640, 0, 0, 32, 20, 3, height, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27647, 0, 0, 32, 20, 9, height, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27654, 0, 0, 32, 20, 3, height, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27661, 0, 0, 32, 20, 3, height, 0, 6, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27641, 0, 0, 24, 16, 3, height, 8, 0, height + 40); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27648, 0, 0, 32, 16, 0, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27655, 0, 0, 32, 16, 0, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27662, 0, 0, 2, 16, 3, height, 30, 16, height + 70); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27642, 0, 0, 8, 16, 3, height, 24, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27649, 0, 0, 32, 16, 0, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27656, 0, 0, 32, 16, 0, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27663, 0, 0, 2, 16, 3, height, 30, 16, height + 100); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 224, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27643, 0, 0, 2, 2, 3, height, 30, 30, height + 80); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27650, 0, 0, 16, 16, 0, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27657, 0, 0, 16, 16, 0, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27664, 0, 0, 2, 16, 3, height, 30, 0, height + 90); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 128, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27644, 0, 0, 2, 16, 3, height, 30, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27651, 0, 0, 32, 16, 0, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27658, 0, 0, 32, 16, 0, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27665, 0, 0, 2, 16, 3, height, 30, 0, height + 140); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 224, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27645, 0, 0, 32, 16, 0, height, 0, 16, height + 32); + metal_a_supports_paint_setup(3, 4, 27, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27652, 0, 0, 32, 16, 0, height, 0, 16, height); + metal_a_supports_paint_setup(3, 4, 27, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27659, 0, 0, 32, 16, 0, height, 0, 0, height); + metal_a_supports_paint_setup(3, 4, 25, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27666, 0, 0, 32, 16, 0, height, 0, 0, height + 32); + metal_a_supports_paint_setup(3, 4, 27, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 32, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); + break; + } +} + +static void inverted_rc_track_right_large_half_loop_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27688, 0, 0, 32, 20, 3, height, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27681, 0, 0, 32, 20, 3, height, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27674, 0, 0, 32, 20, 3, height, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27667, 0, 0, 32, 20, 3, height, 0, 6, height + 29); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27689, 0, 0, 32, 20, 3, height, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27682, 0, 0, 32, 20, 3, height, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27675, 0, 0, 32, 20, 19, height, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27668, 0, 0, 32, 20, 3, height, 0, 6, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27690, 0, 0, 32, 16, 3, height, 0, 16, height + 70); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27683, 0, 0, 32, 16, 0, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27676, 0, 0, 32, 16, 0, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27669, 0, 0, 32, 16, 3, height, 0, 0, height + 70); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27691, 0, 0, 32, 16, 3, height, 0, 16, height + 100); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27684, 0, 0, 32, 16, 0, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27677, 0, 0, 32, 16, 0, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27670, 0, 0, 32, 16, 3, height, 0, 0, height + 100); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 224, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27692, 0, 0, 16, 16, 3, height, 16, 0, height + 90); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27685, 0, 0, 16, 16, 0, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27678, 0, 0, 16, 16, 0, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27671, 0, 0, 2, 16, 3, height, 30, 16, height + 110); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 128, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27693, 0, 0, 2, 16, 3, height, 30, 0, height + 140); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27686, 0, 0, 32, 16, 0, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27679, 0, 0, 32, 16, 0, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27672, 0, 0, 2, 16, 3, height, 30, 16, height + 140); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 224, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27694, 0, 0, 32, 16, 0, height, 0, 0, height + 32); + metal_a_supports_paint_setup(3, 4, 27, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27687, 0, 0, 32, 16, 0, height, 0, 0, height); + metal_a_supports_paint_setup(3, 4, 25, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27680, 0, 0, 32, 16, 0, height, 0, 16, height); + metal_a_supports_paint_setup(3, 4, 27, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27673, 0, 0, 32, 16, 0, height, 0, 16, height + 32); + metal_a_supports_paint_setup(3, 4, 27, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 32, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); + break; + } +} + +static void inverted_rc_track_right_large_half_loop_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_right_large_half_loop_up(rideIndex, 6 - trackSequence, direction, height, mapElement); +} + +static void inverted_rc_track_left_large_half_loop_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_left_large_half_loop_up(rideIndex, 6 - trackSequence, direction, height, mapElement); +} + +static void inverted_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27337, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27338, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void inverted_rc_track_left_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27762, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27764, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27766, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27760, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27761, 6, 0, 20, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27763, 6, 0, 20, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27765, 6, 0, 20, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27759, 6, 0, 20, 32, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_5); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void inverted_rc_track_right_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27751, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27753, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27755, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27757, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27752, 6, 0, 20, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27754, 6, 0, 20, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27756, 6, 0, 20, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27758, 6, 0, 20, 32, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_5); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void inverted_rc_track_left_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + inverted_rc_track_right_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void inverted_rc_track_right_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + inverted_rc_track_left_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void inverted_rc_track_left_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27787, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27792, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27797, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27802, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27788, 0, 0, 32, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27793, 0, 0, 32, 16, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27798, 0, 16, 32, 16, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27803, 0, 16, 32, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27789, 0, 16, 16, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27794, 16, 16, 16, 16, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27799, 16, 0, 16, 16, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27804, 0, 0, 16, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27790, 16, 0, 16, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27795, 0, 0, 16, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27800, 0, 0, 16, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27805, 16, 0, 16, 32, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27791, 6, 0, 20, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27796, 6, 0, 20, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27801, 6, 0, 20, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27806, 6, 0, 20, 32, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_5); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void inverted_rc_track_right_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27767, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27772, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27777, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27782, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27768, 0, 16, 32, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27773, 0, 16, 32, 16, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27778, 0, 0, 32, 16, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27783, 0, 0, 32, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27769, 0, 0, 16, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27774, 16, 0, 16, 16, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27779, 16, 16, 16, 16, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27784, 0, 16, 16, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27770, 16, 0, 16, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27775, 0, 0, 16, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27780, 0, 0, 16, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27785, 16, 0, 16, 32, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27771, 6, 0, 20, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27776, 6, 0, 20, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27781, 6, 0, 20, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27786, 6, 0, 20, 32, 3, height + 29); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_5); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void inverted_rc_track_left_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + inverted_rc_track_right_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void inverted_rc_track_right_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + inverted_rc_track_left_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void inverted_rc_track_25_deg_up_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27719, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27720, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27721, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27722, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void inverted_rc_track_25_deg_up_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27723, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27724, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27725, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27726, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void inverted_rc_track_left_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27727, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27728, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27729, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27730, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void inverted_rc_track_right_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27731, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27732, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27733, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27734, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void inverted_rc_track_25_deg_down_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_right_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_25_deg_down_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_left_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_left_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_25_deg_up_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_right_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_25_deg_up_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_left_banked_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27735, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27736, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27737, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27738, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void inverted_rc_track_right_banked_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27739, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27740, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27741, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27742, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void inverted_rc_track_left_banked_25_deg_up_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27743, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27744, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27745, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27746, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_13); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void inverted_rc_track_right_banked_25_deg_up_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27747, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27748, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27749, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27750, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_13); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void inverted_rc_track_left_banked_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_right_banked_25_deg_up_to_right_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_right_banked_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_left_banked_25_deg_up_to_left_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_left_banked_25_deg_down_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_right_banked_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_right_banked_25_deg_down_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_left_banked_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27695, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27696, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27697, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27698, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void inverted_rc_track_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27699, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27700, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27701, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27702, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void inverted_rc_track_left_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27703, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27704, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27705, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27706, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_13); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void inverted_rc_track_right_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27707, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27708, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27709, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27710, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_13); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void inverted_rc_track_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_right_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_left_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_left_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_rc_track_right_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_rc_track_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_inverted_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return inverted_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return inverted_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return inverted_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return inverted_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return inverted_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return inverted_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return inverted_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return inverted_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return inverted_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return inverted_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return inverted_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return inverted_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return inverted_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return inverted_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return inverted_rc_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return inverted_rc_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return inverted_rc_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return inverted_rc_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return inverted_rc_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return inverted_rc_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return inverted_rc_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return inverted_rc_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return inverted_rc_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return inverted_rc_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return inverted_rc_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return inverted_rc_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return inverted_rc_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return inverted_rc_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return inverted_rc_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return inverted_rc_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return inverted_rc_track_right_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: + return inverted_rc_track_left_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: + return inverted_rc_track_right_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return inverted_rc_track_left_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return inverted_rc_track_right_quarter_turn_5_25_deg_down; + case TRACK_ELEM_S_BEND_LEFT: + return inverted_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return inverted_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_VERTICAL_LOOP: + return inverted_rc_track_left_vertical_loop; + case TRACK_ELEM_RIGHT_VERTICAL_LOOP: + return inverted_rc_track_right_vertical_loop; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return inverted_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return inverted_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return inverted_rc_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return inverted_rc_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return inverted_rc_track_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return inverted_rc_track_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return inverted_rc_track_left_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return inverted_rc_track_right_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_TWIST_DOWN_TO_UP: + return inverted_rc_track_left_twist_down_to_up; + case TRACK_ELEM_RIGHT_TWIST_DOWN_TO_UP: + return inverted_rc_track_right_twist_down_to_up; + case TRACK_ELEM_LEFT_TWIST_UP_TO_DOWN: + return inverted_rc_track_left_twist_up_to_down; + case TRACK_ELEM_RIGHT_TWIST_UP_TO_DOWN: + return inverted_rc_track_right_twist_up_to_down; + case TRACK_ELEM_HALF_LOOP_UP: + return inverted_rc_track_half_loop_up; + case TRACK_ELEM_HALF_LOOP_DOWN: + return inverted_rc_track_half_loop_down; + case TRACK_ELEM_LEFT_CORKSCREW_UP: + return inverted_rc_track_left_corkscrew_up; + case TRACK_ELEM_RIGHT_CORKSCREW_UP: + return inverted_rc_track_right_corkscrew_up; + case TRACK_ELEM_LEFT_CORKSCREW_DOWN: + return inverted_rc_track_left_corkscrew_down; + case TRACK_ELEM_RIGHT_CORKSCREW_DOWN: + return inverted_rc_track_right_corkscrew_down; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP: + return inverted_rc_track_left_quarter_turn_1_60_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP: + return inverted_rc_track_right_quarter_turn_1_60_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return inverted_rc_track_left_quarter_turn_1_60_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return inverted_rc_track_right_quarter_turn_1_60_deg_down; + case TRACK_ELEM_BRAKES: + return inverted_rc_track_brakes; + case TRACK_ELEM_LEFT_QUARTER_BANKED_HELIX_LARGE_UP: + return inverted_rc_track_left_quarter_banked_helix_large_up; + case TRACK_ELEM_RIGHT_QUARTER_BANKED_HELIX_LARGE_UP: + return inverted_rc_track_right_quarter_banked_helix_large_up; + case TRACK_ELEM_LEFT_QUARTER_BANKED_HELIX_LARGE_DOWN: + return inverted_rc_track_left_quarter_banked_helix_large_down; + case TRACK_ELEM_RIGHT_QUARTER_BANKED_HELIX_LARGE_DOWN: + return inverted_rc_track_right_quarter_banked_helix_large_down; + case TRACK_ELEM_25_DEG_UP_LEFT_BANKED: + return inverted_rc_track_25_deg_up_left_banked; + case TRACK_ELEM_25_DEG_UP_RIGHT_BANKED: + return inverted_rc_track_25_deg_up_right_banked; + case TRACK_ELEM_ON_RIDE_PHOTO: + return inverted_rc_track_on_ride_photo; + case TRACK_ELEM_25_DEG_DOWN_LEFT_BANKED: + return inverted_rc_track_25_deg_down_left_banked; + case TRACK_ELEM_25_DEG_DOWN_RIGHT_BANKED: + return inverted_rc_track_25_deg_down_right_banked; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return inverted_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return inverted_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return inverted_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return inverted_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + return inverted_rc_track_left_eighth_bank_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + return inverted_rc_track_right_eighth_bank_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + return inverted_rc_track_left_eighth_bank_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + return inverted_rc_track_right_eighth_bank_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return inverted_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return inverted_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP: + return inverted_rc_track_diag_60_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return inverted_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + return inverted_rc_track_diag_25_deg_up_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + return inverted_rc_track_diag_60_deg_up_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return inverted_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return inverted_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN: + return inverted_rc_track_diag_60_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return inverted_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + return inverted_rc_track_diag_25_deg_down_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + return inverted_rc_track_diag_60_deg_down_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return inverted_rc_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + return inverted_rc_track_diag_flat_to_left_bank; + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + return inverted_rc_track_diag_flat_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + return inverted_rc_track_diag_left_bank_to_flat; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + return inverted_rc_track_diag_right_bank_to_flat; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + return inverted_rc_track_diag_left_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + return inverted_rc_track_diag_right_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + return inverted_rc_track_diag_25_deg_up_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + return inverted_rc_track_diag_25_deg_up_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + return inverted_rc_track_diag_left_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + return inverted_rc_track_diag_right_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + return inverted_rc_track_diag_25_deg_down_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + return inverted_rc_track_diag_25_deg_down_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK: + return inverted_rc_track_diag_left_bank; + case TRACK_ELEM_DIAG_RIGHT_BANK: + return inverted_rc_track_diag_right_bank; + case TRACK_ELEM_LEFT_LARGE_HALF_LOOP_UP: + return inverted_rc_track_left_large_half_loop_up; + case TRACK_ELEM_RIGHT_LARGE_HALF_LOOP_UP: + return inverted_rc_track_right_large_half_loop_up; + case TRACK_ELEM_RIGHT_LARGE_HALF_LOOP_DOWN: + return inverted_rc_track_right_large_half_loop_down; + case TRACK_ELEM_LEFT_LARGE_HALF_LOOP_DOWN: + return inverted_rc_track_left_large_half_loop_down; + case TRACK_ELEM_BLOCK_BRAKES: + return inverted_rc_track_block_brakes; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return inverted_rc_track_left_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return inverted_rc_track_right_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return inverted_rc_track_left_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return inverted_rc_track_right_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return inverted_rc_track_left_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return inverted_rc_track_right_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return inverted_rc_track_left_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return inverted_rc_track_right_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANKED_25_DEG_UP: + return inverted_rc_track_25_deg_up_to_left_banked_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANKED_25_DEG_UP: + return inverted_rc_track_25_deg_up_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return inverted_rc_track_left_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return inverted_rc_track_right_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANKED_25_DEG_DOWN: + return inverted_rc_track_25_deg_down_to_left_banked_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANKED_25_DEG_DOWN: + return inverted_rc_track_25_deg_down_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return inverted_rc_track_left_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return inverted_rc_track_right_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return inverted_rc_track_left_banked_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return inverted_rc_track_right_banked_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_LEFT_BANKED_FLAT: + return inverted_rc_track_left_banked_25_deg_up_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_RIGHT_BANKED_FLAT: + return inverted_rc_track_right_banked_25_deg_up_to_right_banked_flat; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return inverted_rc_track_left_banked_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return inverted_rc_track_right_banked_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_LEFT_BANKED_FLAT: + return inverted_rc_track_left_banked_25_deg_down_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_RIGHT_BANKED_FLAT: + return inverted_rc_track_right_banked_25_deg_down_to_right_banked_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return inverted_rc_track_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return inverted_rc_track_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_FLAT: + return inverted_rc_track_left_banked_25_deg_up_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_FLAT: + return inverted_rc_track_right_banked_25_deg_up_to_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return inverted_rc_track_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return inverted_rc_track_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_FLAT: + return inverted_rc_track_left_banked_25_deg_down_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_FLAT: + return inverted_rc_track_right_banked_25_deg_down_to_flat; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 3042363fe3..f435318afd 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6244,7 +6244,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_spiral_rc, // RIDE_TYPE_SPIRAL_ROLLER_COASTER get_track_paint_function_stand_up_rc, // RIDE_TYPE_STAND_UP_ROLLER_COASTER get_track_paint_function_suspended_swinging_rc, // RIDE_TYPE_SUSPENDED_SWINGING_COASTER - 0, // RIDE_TYPE_INVERTED_ROLLER_COASTER + get_track_paint_function_inverted_rc, // RIDE_TYPE_INVERTED_ROLLER_COASTER get_track_paint_function_junior_rc, // RIDE_TYPE_JUNIOR_ROLLER_COASTER 0, // RIDE_TYPE_MINIATURE_RAILWAY get_track_paint_function_monorail, // RIDE_TYPE_MONORAIL diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index d1c89e00ba..69fe50d8b6 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -263,6 +263,7 @@ typedef TRACK_PAINT_FUNCTION (*TRACK_PAINT_FUNCTION_GETTER)(int trackType, int d TRACK_PAINT_FUNCTION get_track_paint_function_spiral_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_stand_up_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_suspended_swinging_rc(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_inverted_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_junior_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_monorail(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_boat_ride(int trackType, int direction); From 3c110a3f3b1f5af58baa826a1704c05434ecacf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:25:17 +0200 Subject: [PATCH 06/55] Add generated Mini suspended RC --- src/ride/coaster/mini_suspended_coaster.c | 1595 +++++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 1597 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/mini_suspended_coaster.c b/src/ride/coaster/mini_suspended_coaster.c index 846fd9695d..e7c3b8b020 100644 --- a/src/ride/coaster/mini_suspended_coaster.c +++ b/src/ride/coaster/mini_suspended_coaster.c @@ -13,3 +13,1598 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void mini_suspended_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28433, 0, 6, 32, 20, 1, height + 24); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28434, 0, 6, 32, 20, 1, height + 24); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28383, 0, 6, 32, 20, 1, height + 24); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28384, 0, 6, 32, 20, 1, height + 24); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void mini_suspended_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28435, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 6, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28441, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 8, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28437, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 7, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28442, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 5, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28385, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 6, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28391, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 8, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28387, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 7, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28392, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 5, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void mini_suspended_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28436, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 6, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28443, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 8, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28438, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 7, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28444, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 5, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28386, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 6, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28393, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 8, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28388, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 7, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28394, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 5, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void mini_suspended_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28440, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 6, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28446, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 8, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28439, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 7, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28445, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 5, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28390, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 6, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28396, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 8, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28389, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 7, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28395, 0, 6, 32, 20, 1, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 5, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void mini_suspended_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_suspended_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_suspended_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_suspended_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_suspended_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_suspended_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_suspended_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28406, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28411, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28416, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28401, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28405, 0, 0, 32, 16, 1, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28410, 0, 0, 32, 16, 1, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28415, 0, 16, 32, 16, 1, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28400, 0, 16, 32, 16, 1, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28404, 0, 16, 16, 16, 1, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28409, 16, 16, 16, 16, 1, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28414, 16, 0, 16, 16, 1, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28399, 0, 0, 16, 16, 1, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28403, 16, 0, 16, 32, 1, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28408, 0, 0, 16, 32, 1, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28413, 0, 0, 16, 32, 1, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28398, 16, 0, 16, 32, 1, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28402, 6, 0, 20, 32, 1, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28407, 6, 0, 20, 32, 1, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28412, 6, 0, 20, 32, 1, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28397, 6, 0, 20, 32, 1, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mini_suspended_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mini_suspended_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mini_suspended_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28421, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28428, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28424, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28425, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28422, 0, 0, 32, 26, 1, height + 24); + metal_a_supports_paint_setup(1, 5, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28427, 0, 0, 32, 26, 1, height + 24); + metal_a_supports_paint_setup(2, 6, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28423, 0, 6, 32, 26, 1, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28426, 0, 6, 32, 26, 1, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28423, 0, 6, 32, 26, 1, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28426, 0, 6, 32, 26, 1, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28422, 0, 0, 32, 26, 1, height + 24); + metal_a_supports_paint_setup(1, 5, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28427, 0, 0, 32, 26, 1, height + 24); + metal_a_supports_paint_setup(2, 6, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28424, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28425, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28421, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28428, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mini_suspended_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28417, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28432, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28420, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28429, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28418, 0, 6, 32, 26, 1, height + 24); + metal_a_supports_paint_setup(1, 8, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28431, 0, 6, 32, 26, 1, height + 24); + metal_a_supports_paint_setup(2, 7, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28419, 0, 0, 32, 26, 1, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28430, 0, 0, 32, 26, 1, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28419, 0, 0, 32, 26, 1, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28430, 0, 0, 32, 26, 1, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28418, 0, 6, 32, 26, 1, height + 24); + metal_a_supports_paint_setup(1, 8, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28431, 0, 6, 32, 26, 1, height + 24); + metal_a_supports_paint_setup(2, 7, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28420, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28429, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28417, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28432, 0, 6, 32, 20, 1, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mini_suspended_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28452, 0, 6, 32, 20, 3, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28455, 0, 6, 32, 20, 3, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28458, 0, 6, 32, 20, 3, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28449, 0, 6, 32, 20, 3, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28451, 16, 0, 16, 16, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28454, 0, 0, 16, 16, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28457, 0, 16, 16, 16, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28448, 16, 16, 16, 16, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28450, 6, 0, 20, 32, 3, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28453, 6, 0, 20, 32, 3, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28456, 6, 0, 20, 32, 3, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28447, 6, 0, 20, 32, 3, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_suspended_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mini_suspended_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mini_suspended_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28475, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28479, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28483, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28487, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28476, 0, 0, 32, 16, 1, height + 24, 0, 0, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28480, 0, 0, 34, 16, 1, height + 24, 0, 0, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28484, 0, 0, 32, 16, 1, height + 24, 0, 16, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28488, 0, 0, 32, 16, 1, height + 24, 0, 16, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28477, 0, 0, 16, 16, 1, height + 24, 0, 16, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28481, 0, 0, 16, 16, 1, height + 24, 16, 16, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28485, 0, 0, 16, 16, 1, height + 24, 16, 0, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28489, 0, 0, 16, 16, 1, height + 24, 0, 0, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28478, 0, 0, 16, 16, 1, height + 24, 16, 16, height + 24); + metal_a_supports_paint_setup(1, 3, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28482, 0, 0, 16, 18, 1, height + 24, 0, 16, height + 24); + metal_a_supports_paint_setup(2, 1, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28486, 0, 0, 16, 16, 1, height + 24, 0, 0, height + 24); + metal_a_supports_paint_setup(1, 0, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28490, 0, 0, 16, 16, 1, height + 24, 16, 0, height + 24); + metal_a_supports_paint_setup(2, 2, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mini_suspended_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28459, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28463, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28467, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 24); + metal_a_supports_paint_setup(1, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28471, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 24); + metal_a_supports_paint_setup(2, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28460, 0, 0, 32, 16, 1, height + 24, 0, 16, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28464, 0, 0, 32, 16, 1, height + 24, 0, 16, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28468, 0, 0, 34, 16, 1, height + 24, 0, 0, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28472, 0, 0, 32, 16, 1, height + 24, 0, 0, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28461, 0, 0, 16, 16, 1, height + 24, 0, 0, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28465, 0, 0, 16, 16, 1, height + 24, 16, 0, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28469, 0, 0, 28, 28, 1, height + 24, 4, 2, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28473, 0, 0, 16, 16, 1, height + 24, 0, 16, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28462, 0, 0, 16, 16, 1, height + 24, 16, 0, height + 24); + metal_a_supports_paint_setup(1, 1, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28466, 0, 0, 16, 16, 1, height + 24, 0, 0, height + 24); + metal_a_supports_paint_setup(2, 0, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28470, 0, 0, 16, 18, 1, height + 24, 0, 16, height + 24); + metal_a_supports_paint_setup(1, 2, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28474, 0, 0, 16, 16, 1, height + 24, 16, 16, height + 24); + metal_a_supports_paint_setup(2, 3, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mini_suspended_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + mini_suspended_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_suspended_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + mini_suspended_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void mini_suspended_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28510, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 24); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28494, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 24); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28507, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 24); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28491, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 24); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28509, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 24); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28493, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 24); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28508, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 24); + metal_a_supports_paint_setup(2, 0, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28492, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 24); + metal_a_supports_paint_setup(2, 0, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mini_suspended_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28522, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 40); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28506, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 40); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28519, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 40); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28503, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 40); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28521, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 40); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28505, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 40); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28520, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 40); + metal_a_supports_paint_setup(2, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28504, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 40); + metal_a_supports_paint_setup(2, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mini_suspended_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28514, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28498, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28511, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28495, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28513, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28497, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 0, height + 34, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28512, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(2, 0, 0, height + 34, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 0, height + 34, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 0, height + 34, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 0, height + 34, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28496, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(2, 0, 0, height + 34, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 0, height + 34, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 0, height + 34, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void mini_suspended_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28518, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28502, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28515, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28499, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28517, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28501, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28516, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(2, 0, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28500, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(2, 0, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mini_suspended_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28520, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 40); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28504, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 40); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28521, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 40); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28505, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 40); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28519, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 40); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28503, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 40); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28522, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 40); + metal_a_supports_paint_setup(2, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28506, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 40); + metal_a_supports_paint_setup(2, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mini_suspended_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28516, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28500, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28517, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28501, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28515, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28499, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28518, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(2, 0, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28502, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(2, 0, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mini_suspended_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28512, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28496, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28513, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28497, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28511, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28495, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 0, height + 34, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28514, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(2, 0, 0, height + 34, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 0, height + 34, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 0, height + 34, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 0, height + 34, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28498, -16, -16, 32, 32, 1, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(2, 0, 0, height + 34, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 0, height + 34, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 0, height + 34, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +TRACK_PAINT_FUNCTION get_track_paint_function_mini_suspended_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return mini_suspended_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return mini_suspended_rc_track_25_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return mini_suspended_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return mini_suspended_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return mini_suspended_rc_track_25_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return mini_suspended_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return mini_suspended_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return mini_suspended_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return mini_suspended_rc_track_right_quarter_turn_5; + case TRACK_ELEM_S_BEND_LEFT: + return mini_suspended_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return mini_suspended_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return mini_suspended_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return mini_suspended_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return mini_suspended_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return mini_suspended_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return mini_suspended_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return mini_suspended_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return mini_suspended_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return mini_suspended_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return mini_suspended_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return mini_suspended_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return mini_suspended_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return mini_suspended_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return mini_suspended_rc_track_diag_25_deg_down_to_flat; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index f435318afd..75fb011921 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6248,7 +6248,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_junior_rc, // RIDE_TYPE_JUNIOR_ROLLER_COASTER 0, // RIDE_TYPE_MINIATURE_RAILWAY get_track_paint_function_monorail, // RIDE_TYPE_MONORAIL - 0, // RIDE_TYPE_MINI_SUSPENDED_COASTER + get_track_paint_function_mini_suspended_rc, // RIDE_TYPE_MINI_SUSPENDED_COASTER get_track_paint_function_boat_ride, // RIDE_TYPE_BOAT_RIDE get_track_paint_function_wooden_wild_mouse, // RIDE_TYPE_WOODEN_WILD_MOUSE 0, // RIDE_TYPE_STEEPLECHASE diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 69fe50d8b6..437765bc8c 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -266,6 +266,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_suspended_swinging_rc(int trackTyp TRACK_PAINT_FUNCTION get_track_paint_function_inverted_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_junior_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_monorail(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_mini_suspended_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_boat_ride(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_wooden_wild_mouse(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_car_ride(int trackType, int direction); From 39cb42342a15944f8b04ced5f3ebb8583e53262e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:26:27 +0200 Subject: [PATCH 07/55] Add generated Steeplechase --- src/ride/coaster/steeplechase.c | 1581 +++++++++++++++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 1583 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/steeplechase.c b/src/ride/coaster/steeplechase.c index 846fd9695d..634ee567df 100644 --- a/src/ride/coaster/steeplechase.c +++ b/src/ride/coaster/steeplechase.c @@ -13,3 +13,1584 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void steeplechase_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28635, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28636, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28633, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28634, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void steeplechase_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28649, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28655, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28651, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28656, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28637, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28643, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28639, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28644, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void steeplechase_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28650, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28657, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28652, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28658, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28638, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28645, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28640, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28646, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void steeplechase_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28654, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28660, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28653, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28659, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28642, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28648, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28641, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28647, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void steeplechase_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + steeplechase_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void steeplechase_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + steeplechase_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void steeplechase_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + steeplechase_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void steeplechase_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28698, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28703, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28708, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height - 3, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28693, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 0, height - 1, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28697, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28702, 0, 0, 32, 16, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28707, 0, 16, 32, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28692, 0, 16, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28696, 0, 16, 16, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28701, 16, 16, 16, 16, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28706, 16, 0, 16, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28691, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28695, 16, 0, 16, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28700, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28705, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28690, 16, 0, 16, 32, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28694, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(5, 4, 0, height - 3, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28699, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28704, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(5, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28689, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height - 2, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void steeplechase_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + steeplechase_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void steeplechase_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28665, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28672, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28668, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28669, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 0, height - 2, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28666, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(4, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28671, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(5, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28667, 0, 6, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28670, 0, 6, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28667, 0, 6, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28670, 0, 6, 32, 26, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28666, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(4, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28671, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(5, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28668, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28669, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 0, height - 2, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28665, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28672, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void steeplechase_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28661, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28676, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28664, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28673, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28662, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(4, 8, 0, height - 2, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28675, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(5, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28663, 0, 0, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28674, 0, 0, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28663, 0, 0, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28674, 0, 0, 32, 26, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28662, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(4, 8, 0, height - 2, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28675, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(5, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28664, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28673, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28661, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28676, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void steeplechase_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28682, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28685, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28688, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28679, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 0, height - 3, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28681, 16, 0, 16, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28684, 0, 0, 16, 16, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28687, 0, 16, 16, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28678, 16, 16, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28680, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(5, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28683, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(4, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28686, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(5, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28677, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height - 3, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void steeplechase_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + steeplechase_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void steeplechase_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28635, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28636, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void steeplechase_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28725, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28729, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(5, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28733, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28737, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(5, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28726, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28730, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28734, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28738, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28727, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28731, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28735, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28739, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28728, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(4, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28732, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(5, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28736, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(4, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28740, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(5, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void steeplechase_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28709, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28713, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(5, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28717, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28721, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(5, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28710, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28714, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28718, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28722, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28711, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28715, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28719, 0, 0, 28, 28, 3, height, 4, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28723, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28712, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(4, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28716, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(5, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28720, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(4, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28724, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(5, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void steeplechase_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + steeplechase_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void steeplechase_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + steeplechase_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void steeplechase_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28760, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28744, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28757, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28741, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28759, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28743, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(4, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28758, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(5, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(4, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(5, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(4, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28742, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(5, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(4, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(5, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void steeplechase_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28772, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28756, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28769, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28753, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28771, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28755, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(4, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28770, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(5, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(4, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(5, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(4, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28754, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(5, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(4, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(5, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void steeplechase_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28764, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28748, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28761, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28745, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28763, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28747, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(4, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28762, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(5, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(4, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(5, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(4, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28746, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(5, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(4, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(5, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void steeplechase_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28768, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28752, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28765, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28749, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28767, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28751, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(4, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28766, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(5, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(4, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(5, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(4, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28750, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(5, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(4, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(5, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void steeplechase_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28770, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28754, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28771, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28755, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28769, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28753, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(4, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28772, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(5, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(4, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(5, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(4, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28756, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(5, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(4, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(5, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void steeplechase_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28766, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28750, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28767, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28751, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28765, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28749, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(4, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28768, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(5, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(4, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(5, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(4, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28752, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(5, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(4, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(5, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void steeplechase_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28762, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28746, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28763, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28747, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28761, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28745, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(4, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28764, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(5, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(4, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(5, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(4, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28748, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(5, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(4, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(5, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void steeplechase_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28635, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(4, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 28636, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(5, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_steeplechase(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return steeplechase_track_flat; + case TRACK_ELEM_25_DEG_UP: + return steeplechase_track_25_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return steeplechase_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return steeplechase_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return steeplechase_track_25_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return steeplechase_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return steeplechase_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return steeplechase_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return steeplechase_track_right_quarter_turn_5; + case TRACK_ELEM_S_BEND_LEFT: + return steeplechase_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return steeplechase_track_s_bend_right; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return steeplechase_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return steeplechase_track_right_quarter_turn_3; + case TRACK_ELEM_BRAKES: + return steeplechase_track_brakes; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return steeplechase_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return steeplechase_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return steeplechase_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return steeplechase_track_right_eighth_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return steeplechase_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return steeplechase_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return steeplechase_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return steeplechase_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return steeplechase_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return steeplechase_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return steeplechase_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_BLOCK_BRAKES: + return steeplechase_track_block_brakes; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 75fb011921..5bd2d8f010 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6251,7 +6251,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_mini_suspended_rc, // RIDE_TYPE_MINI_SUSPENDED_COASTER get_track_paint_function_boat_ride, // RIDE_TYPE_BOAT_RIDE get_track_paint_function_wooden_wild_mouse, // RIDE_TYPE_WOODEN_WILD_MOUSE - 0, // RIDE_TYPE_STEEPLECHASE + get_track_paint_function_steeplechase, // RIDE_TYPE_STEEPLECHASE get_track_paint_function_car_ride, // RIDE_TYPE_CAR_RIDE get_track_paint_function_launched_freefall, // RIDE_TYPE_LAUNCHED_FREEFALL 0, // RIDE_TYPE_BOBSLEIGH_COASTER diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 437765bc8c..05110af7df 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -269,6 +269,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_monorail(int trackType, int direct TRACK_PAINT_FUNCTION get_track_paint_function_mini_suspended_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_boat_ride(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_wooden_wild_mouse(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_steeplechase(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_car_ride(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_launched_freefall(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_observation_tower(int trackType, int direction); From 4f091aac4d3d4b8fc32f0adde1a2b42950c9202f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:30:19 +0200 Subject: [PATCH 08/55] Add generated Bobsleigh RC --- src/ride/coaster/bobsleigh_coaster.c | 2261 ++++++++++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 2263 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/bobsleigh_coaster.c b/src/ride/coaster/bobsleigh_coaster.c index 846fd9695d..ae7cea39a9 100644 --- a/src/ride/coaster/bobsleigh_coaster.c +++ b/src/ride/coaster/bobsleigh_coaster.c @@ -13,3 +13,2264 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void bobsleigh_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14576, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14578, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14577, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14579, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14572, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14574, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14573, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14575, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void bobsleigh_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14634, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14638, 0, 0, 32, 1, 50, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14635, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14639, 0, 0, 32, 1, 50, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14636, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14640, 0, 0, 32, 1, 50, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14637, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14641, 0, 0, 32, 1, 50, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14610, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14614, 0, 0, 32, 1, 50, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14611, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14615, 0, 0, 32, 1, 50, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14612, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14616, 0, 0, 32, 1, 50, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14613, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14617, 0, 0, 32, 1, 50, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void bobsleigh_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14618, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14622, 0, 0, 32, 1, 42, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14619, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14623, 0, 0, 32, 1, 42, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14620, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14624, 0, 0, 32, 1, 42, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14621, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14625, 0, 0, 32, 1, 42, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14594, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14598, 0, 0, 32, 1, 42, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14595, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14599, 0, 0, 32, 1, 42, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14596, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14600, 0, 0, 32, 1, 42, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14597, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14601, 0, 0, 32, 1, 42, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void bobsleigh_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14626, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14630, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14627, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14631, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14628, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14632, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14629, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14633, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14602, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14606, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14603, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14607, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14604, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14608, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14605, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14609, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void bobsleigh_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + bobsleigh_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void bobsleigh_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + bobsleigh_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void bobsleigh_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + bobsleigh_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void bobsleigh_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14707, 0, 2, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14727, 0, 2, 32, 20, 0, height, 0, 6, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14712, 0, 2, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14732, 0, 2, 32, 20, 0, height, 0, 6, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14717, 0, 2, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14737, 0, 2, 32, 20, 0, height, 0, 6, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14702, 0, 2, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14722, 0, 2, 32, 20, 0, height, 0, 6, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14706, 0, 0, 32, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14726, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14711, 0, 0, 32, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14731, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14716, 0, 16, 32, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14736, 0, 16, 32, 16, 0, height, 0, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14701, 0, 16, 32, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14721, 0, 16, 32, 16, 0, height, 0, 16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14705, 0, 16, 16, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14725, 0, 16, 16, 16, 0, height, 0, 16, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14710, 16, 16, 16, 16, 2, height, 16, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14730, 16, 16, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14715, 16, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14735, 16, 0, 16, 16, 0, height, 16, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14700, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14720, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14704, 16, 0, 16, 34, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14724, 16, 0, 16, 34, 0, height, 16, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14709, 0, 0, 16, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14729, 0, 0, 16, 32, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14714, 0, 0, 16, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14734, 0, 0, 16, 32, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14699, 16, 0, 16, 32, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14719, 16, 0, 16, 32, 0, height, 16, 0, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14703, 2, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14723, 2, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14708, 2, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14728, 2, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14713, 2, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14733, 2, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14698, 2, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14718, 2, 0, 30, 32, 0, height, 6, 0, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void bobsleigh_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + bobsleigh_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void bobsleigh_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14642, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14646, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14643, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14647, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14644, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14648, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14645, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14649, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void bobsleigh_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14650, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14654, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14651, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14655, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14652, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14656, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14653, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14657, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void bobsleigh_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14652, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14656, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14653, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14657, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14650, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14654, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14651, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14655, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void bobsleigh_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14644, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14648, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14645, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14649, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14642, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14646, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14643, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14647, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void bobsleigh_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14747, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14767, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14752, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14772, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14757, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14777, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14742, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14762, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14746, 0, 0, 32, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14766, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14751, 0, 0, 32, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14771, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14756, 0, 0, 32, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14776, 0, 0, 32, 16, 0, height, 0, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14741, 0, 0, 32, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14761, 0, 0, 32, 16, 0, height, 0, 16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14745, 0, 0, 16, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14765, 0, 0, 16, 16, 0, height, 0, 16, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14750, 0, 0, 16, 16, 2, height, 16, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14770, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14755, 0, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14775, 0, 0, 16, 16, 0, height, 16, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14740, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14760, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14744, 0, 0, 16, 32, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14764, 0, 0, 16, 32, 0, height, 16, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14749, 0, 0, 16, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14769, 0, 0, 16, 32, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14754, 0, 0, 16, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14774, 0, 0, 16, 32, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14739, 0, 0, 16, 32, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14759, 0, 0, 16, 32, 0, height, 16, 0, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14743, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14763, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14748, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14768, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14753, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14773, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14738, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14758, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void bobsleigh_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + bobsleigh_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void bobsleigh_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14674, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14678, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14675, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14679, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14676, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14680, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14677, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14681, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void bobsleigh_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14682, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14686, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14683, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14687, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14684, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14688, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14685, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14689, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void bobsleigh_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14658, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14662, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14659, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14663, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14660, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14664, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14661, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14665, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void bobsleigh_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14666, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14670, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14667, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14671, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14668, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14672, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14669, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14673, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void bobsleigh_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + bobsleigh_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void bobsleigh_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + bobsleigh_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void bobsleigh_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + bobsleigh_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void bobsleigh_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + bobsleigh_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void bobsleigh_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14690, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14694, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14691, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14695, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14692, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14696, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14693, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14697, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void bobsleigh_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + bobsleigh_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void bobsleigh_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14826, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14842, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14830, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14846, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14829, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14845, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14833, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14849, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14827, 0, 0, 32, 26, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14843, 0, 0, 32, 26, 0, height, 0, 0, height + 27); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14831, 0, 0, 32, 26, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14847, 0, 0, 32, 26, 0, height, 0, 0, height + 27); + metal_a_supports_paint_setup(0, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14828, 0, 0, 32, 26, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14844, 0, 0, 32, 26, 0, height, 0, 6, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14832, 0, 0, 32, 26, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14848, 0, 0, 32, 26, 0, height, 0, 6, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14828, 0, 0, 32, 26, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14844, 0, 0, 32, 26, 0, height, 0, 6, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14832, 0, 0, 32, 26, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14848, 0, 0, 32, 26, 0, height, 0, 6, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14827, 0, 0, 32, 26, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14843, 0, 0, 32, 26, 0, height, 0, 0, height + 27); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14831, 0, 0, 32, 26, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14847, 0, 0, 32, 26, 0, height, 0, 0, height + 27); + metal_a_supports_paint_setup(0, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14829, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14845, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14833, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14849, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14826, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14842, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14830, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14846, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void bobsleigh_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14834, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14850, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14838, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14854, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14837, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14853, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14841, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14857, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14835, 0, 0, 32, 26, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14851, 0, 0, 32, 26, 0, height, 0, 6, height + 27); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14839, 0, 0, 32, 26, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14855, 0, 0, 32, 26, 0, height, 0, 6, height + 27); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14836, 0, 0, 32, 26, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14852, 0, 0, 32, 26, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14840, 0, 0, 32, 26, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14856, 0, 0, 32, 26, 0, height, 0, 0, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14836, 0, 0, 32, 26, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14852, 0, 0, 32, 26, 0, height, 0, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14840, 0, 0, 32, 26, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14856, 0, 0, 32, 26, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14835, 0, 0, 32, 26, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14851, 0, 0, 32, 26, 0, height, 0, 6, height + 27); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14839, 0, 0, 32, 26, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14855, 0, 0, 32, 26, 0, height, 0, 6, height + 27); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14837, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14853, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14841, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14857, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14834, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14850, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14838, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14854, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void bobsleigh_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14783, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14795, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14786, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14798, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14789, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14801, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14780, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14792, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14782, 0, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14794, 0, 0, 16, 16, 0, height, 16, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14785, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14797, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14788, 0, 0, 16, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14800, 0, 0, 16, 16, 0, height, 0, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14779, 0, 0, 16, 16, 2, height, 16, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14791, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14781, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14793, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14784, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14796, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14787, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14799, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14778, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14790, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void bobsleigh_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + bobsleigh_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void bobsleigh_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14807, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14819, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14810, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14822, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14813, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14825, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14804, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14816, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14806, 0, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14818, 0, 0, 16, 16, 0, height, 16, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14809, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14821, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14812, 0, 0, 16, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14824, 0, 0, 16, 16, 0, height, 0, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14803, 0, 0, 16, 16, 2, height, 16, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14815, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14805, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14817, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14808, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14820, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14811, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14823, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14802, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14814, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void bobsleigh_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + bobsleigh_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void bobsleigh_rc_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14887, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14899, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14890, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14902, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14893, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14905, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14884, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14896, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14886, 0, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14898, 0, 0, 16, 16, 0, height, 16, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14889, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14901, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14892, 0, 0, 16, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14904, 0, 0, 16, 16, 0, height, 0, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14883, 0, 0, 16, 16, 2, height, 16, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14895, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14885, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14897, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14888, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14900, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14891, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14903, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14882, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14894, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14884, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14896, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14887, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14899, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14890, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14902, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14893, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14905, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14883, 0, 0, 16, 16, 2, height, 16, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14895, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14886, 0, 0, 16, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14898, 0, 0, 16, 16, 0, height, 0, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14889, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14901, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14892, 0, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14904, 0, 0, 16, 16, 0, height, 16, 0, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14882, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14894, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14885, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14897, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14888, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14900, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14891, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14903, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void bobsleigh_rc_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14858, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14870, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14861, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14873, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14864, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14876, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14867, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14879, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14859, 0, 0, 16, 16, 2, height, 16, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14871, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14862, 0, 0, 16, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14874, 0, 0, 16, 16, 0, height, 0, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14865, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14877, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14868, 0, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14880, 0, 0, 16, 16, 0, height, 16, 0, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14860, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14872, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14863, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14875, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14866, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14878, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14869, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14881, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14861, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14873, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14864, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14876, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14867, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14879, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14858, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14870, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14862, 0, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14874, 0, 0, 16, 16, 0, height, 16, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14865, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14877, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14868, 0, 0, 16, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14880, 0, 0, 16, 16, 0, height, 0, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14859, 0, 0, 16, 16, 2, height, 16, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14871, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14863, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14875, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14866, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14878, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14869, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14881, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14860, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14872, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void bobsleigh_rc_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + bobsleigh_rc_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void bobsleigh_rc_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + bobsleigh_rc_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void bobsleigh_rc_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14955, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14975, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14960, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14980, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14965, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14985, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14950, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14970, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14954, 0, 0, 32, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14974, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14959, 0, 0, 32, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14979, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14964, 0, 0, 32, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14984, 0, 0, 32, 16, 0, height, 0, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14949, 0, 0, 32, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14969, 0, 0, 32, 16, 0, height, 0, 16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14953, 0, 0, 16, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14973, 0, 0, 16, 16, 0, height, 0, 16, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14958, 0, 0, 16, 16, 2, height, 16, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14978, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14963, 0, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14983, 0, 0, 16, 16, 0, height, 16, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14948, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14968, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14952, 0, 0, 16, 32, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14972, 0, 0, 16, 32, 0, height, 16, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14957, 0, 0, 16, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14977, 0, 0, 16, 32, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14962, 0, 0, 16, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14982, 0, 0, 16, 32, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14947, 0, 0, 16, 32, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14967, 0, 0, 16, 32, 0, height, 16, 0, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14951, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14971, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14956, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14976, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14961, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14981, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14946, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14966, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14950, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14970, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14955, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14975, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14960, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14980, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14965, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14985, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14949, 0, 0, 16, 32, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14969, 0, 0, 16, 32, 0, height, 16, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14954, 0, 0, 16, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14974, 0, 0, 16, 32, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14959, 0, 0, 16, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14979, 0, 0, 16, 32, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14964, 0, 0, 16, 32, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14984, 0, 0, 16, 32, 0, height, 16, 0, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14948, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14968, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14953, 0, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14973, 0, 0, 16, 16, 0, height, 16, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14958, 0, 0, 16, 16, 2, height, 16, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14978, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14963, 0, 0, 16, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14983, 0, 0, 16, 16, 0, height, 0, 16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14947, 0, 0, 32, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14967, 0, 0, 32, 16, 0, height, 0, 16, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14952, 0, 0, 32, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14972, 0, 0, 32, 16, 0, height, 0, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14957, 0, 0, 32, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14977, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14962, 0, 0, 32, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14982, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14946, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14966, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14951, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14971, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14956, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14976, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14961, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14981, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void bobsleigh_rc_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14906, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14926, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14911, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14931, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14916, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14936, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14921, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14941, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14907, 0, 0, 32, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14927, 0, 0, 32, 16, 0, height, 0, 16, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14912, 0, 0, 32, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14932, 0, 0, 32, 16, 0, height, 0, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14917, 0, 0, 32, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14937, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14922, 0, 0, 32, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14942, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14908, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14928, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14913, 0, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14933, 0, 0, 16, 16, 0, height, 16, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14918, 0, 0, 16, 16, 2, height, 16, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14938, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14923, 0, 0, 16, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14943, 0, 0, 16, 16, 0, height, 0, 16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14909, 0, 0, 16, 32, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14929, 0, 0, 16, 32, 0, height, 16, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14914, 0, 0, 16, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14934, 0, 0, 16, 32, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14919, 0, 0, 16, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14939, 0, 0, 16, 32, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14924, 0, 0, 16, 32, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14944, 0, 0, 16, 32, 0, height, 16, 0, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14910, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14930, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14915, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14935, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14920, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14940, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14925, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14945, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14911, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14931, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14916, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14936, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14921, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14941, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14906, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14926, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14912, 0, 0, 16, 32, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14932, 0, 0, 16, 32, 0, height, 16, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14917, 0, 0, 16, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14937, 0, 0, 16, 32, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14922, 0, 0, 16, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14942, 0, 0, 16, 32, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14907, 0, 0, 16, 32, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14927, 0, 0, 16, 32, 0, height, 16, 0, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14913, 0, 0, 16, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14933, 0, 0, 16, 16, 0, height, 0, 16, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14918, 0, 0, 16, 16, 2, height, 16, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14938, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14923, 0, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14943, 0, 0, 16, 16, 0, height, 16, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14908, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14928, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14914, 0, 0, 32, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14934, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14919, 0, 0, 32, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14939, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14924, 0, 0, 32, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14944, 0, 0, 32, 16, 0, height, 0, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14909, 0, 0, 32, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14929, 0, 0, 32, 16, 0, height, 0, 16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14915, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14935, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14920, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14940, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14925, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14945, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14910, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14930, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void bobsleigh_rc_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + bobsleigh_rc_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void bobsleigh_rc_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + bobsleigh_rc_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void bobsleigh_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14582, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14584, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14583, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14585, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void bobsleigh_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14586, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14590, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14587, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 14591, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_bobsleigh_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return bobsleigh_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return bobsleigh_rc_track_25_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return bobsleigh_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return bobsleigh_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return bobsleigh_rc_track_25_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return bobsleigh_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return bobsleigh_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return bobsleigh_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return bobsleigh_rc_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return bobsleigh_rc_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return bobsleigh_rc_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return bobsleigh_rc_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return bobsleigh_rc_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return bobsleigh_rc_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return bobsleigh_rc_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return bobsleigh_rc_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return bobsleigh_rc_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return bobsleigh_rc_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return bobsleigh_rc_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return bobsleigh_rc_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return bobsleigh_rc_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return bobsleigh_rc_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return bobsleigh_rc_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return bobsleigh_rc_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return bobsleigh_rc_track_right_bank; + case TRACK_ELEM_S_BEND_LEFT: + return bobsleigh_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return bobsleigh_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return bobsleigh_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return bobsleigh_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return bobsleigh_rc_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return bobsleigh_rc_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: + return bobsleigh_rc_track_left_half_banked_helix_up_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: + return bobsleigh_rc_track_right_half_banked_helix_up_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: + return bobsleigh_rc_track_left_half_banked_helix_down_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: + return bobsleigh_rc_track_right_half_banked_helix_down_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: + return bobsleigh_rc_track_left_half_banked_helix_up_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: + return bobsleigh_rc_track_right_half_banked_helix_up_large; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: + return bobsleigh_rc_track_left_half_banked_helix_down_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: + return bobsleigh_rc_track_right_half_banked_helix_down_large; + case TRACK_ELEM_BRAKES: + return bobsleigh_rc_track_brakes; + case TRACK_ELEM_BLOCK_BRAKES: + return bobsleigh_rc_track_block_brakes; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 5bd2d8f010..8c28f66d4c 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6254,7 +6254,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_steeplechase, // RIDE_TYPE_STEEPLECHASE get_track_paint_function_car_ride, // RIDE_TYPE_CAR_RIDE get_track_paint_function_launched_freefall, // RIDE_TYPE_LAUNCHED_FREEFALL - 0, // RIDE_TYPE_BOBSLEIGH_COASTER + get_track_paint_function_bobsleigh_rc, // RIDE_TYPE_BOBSLEIGH_COASTER get_track_paint_function_observation_tower, // RIDE_TYPE_OBSERVATION_TOWER 0, // RIDE_TYPE_LOOPING_ROLLER_COASTER get_track_paint_function_dinghy_slide, // RIDE_TYPE_DINGHY_SLIDE diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 05110af7df..ec0453a2c8 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -272,6 +272,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_wooden_wild_mouse(int trackType, i TRACK_PAINT_FUNCTION get_track_paint_function_steeplechase(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_car_ride(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_launched_freefall(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_bobsleigh_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_observation_tower(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_dinghy_slide(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_chairlift(int trackType, int direction); From 6f94e9fc6dfd1889560322a695d46bea2a5c5240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:31:33 +0200 Subject: [PATCH 09/55] Add generated Looping RC --- src/ride/coaster/looping_roller_coaster.c | 6425 +++++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 6427 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/looping_roller_coaster.c b/src/ride/coaster/looping_roller_coaster.c index 846fd9695d..d92a700185 100644 --- a/src/ride/coaster/looping_roller_coaster.c +++ b/src/ride/coaster/looping_roller_coaster.c @@ -13,3 +13,6428 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void looping_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15006, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15007, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15008, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15009, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15004, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15005, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void looping_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15060, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15061, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15062, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15063, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15032, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15033, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15034, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15035, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void looping_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15076, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15077, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15078, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15079, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15048, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15049, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15050, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15051, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void looping_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15052, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15053, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15054, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15055, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15024, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15025, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15026, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15027, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void looping_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15064, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15065, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15068, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15066, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15069, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15067, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15036, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15037, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15040, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15038, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15041, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15039, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void looping_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15070, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15071, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15074, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15072, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15075, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15073, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15042, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15043, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15046, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15044, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15047, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15045, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void looping_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15056, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15057, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15058, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15059, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15028, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15029, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15030, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15031, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void looping_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15183, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15188, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15193, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15178, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15182, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15187, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15192, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15177, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15181, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15186, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15191, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15176, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15180, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15185, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15190, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15175, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15179, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15184, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15189, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15174, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + looping_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void looping_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15080, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15092, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15081, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15093, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15082, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15083, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void looping_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15084, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15085, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15086, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15094, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15087, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15095, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void looping_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15086, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15094, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15087, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15095, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15084, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15085, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void looping_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15082, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15083, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15080, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15092, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15081, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15093, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void looping_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15203, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15214, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15208, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15213, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15198, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15202, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15207, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15212, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15197, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15201, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15206, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15211, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15196, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15200, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15205, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15210, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15195, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15199, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15204, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15209, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15215, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15194, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + looping_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void looping_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15096, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15112, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15097, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15113, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15098, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15099, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void looping_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15100, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15101, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15102, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15114, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15103, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15115, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void looping_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15104, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15116, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15105, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15117, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15106, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15107, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void looping_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15108, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15109, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15110, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15118, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15111, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15119, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void looping_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15088, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15089, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15090, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15091, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void looping_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15296, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15301, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15306, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15311, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15297, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15302, 0, 0, 32, 16, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15307, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15312, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15298, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15303, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15308, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15313, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15299, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15304, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15309, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15314, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15300, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15305, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15310, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15315, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void looping_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15276, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15281, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15286, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15291, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15277, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15282, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15287, 0, 0, 32, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15292, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15278, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15283, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15288, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15293, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15279, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15284, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15289, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15294, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15280, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15285, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15290, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15295, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void looping_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + looping_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void looping_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + looping_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void looping_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15260, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15264, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15263, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15267, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15261, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15265, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15262, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15266, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15262, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15266, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15261, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15265, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15263, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15267, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15260, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15264, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15268, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15272, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15271, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15275, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15269, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15273, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15270, 0, 0, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15274, 0, 0, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15270, 0, 0, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15274, 0, 0, 32, 26, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15269, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15273, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15271, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15275, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15268, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15272, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_left_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15348, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15356, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15355, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15363, 0, 6, 32, 20, 7, height); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15349, 0, 0, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15357, 0, 14, 32, 2, 63, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15354, 0, 6, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15362, 0, 6, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15350, 16, 0, 3, 16, 119, height, 16, 0, height); + metal_a_supports_paint_setup(6, 1, 0, height - 8, gTrackColours[SCHEME_TRACK]); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15364, 16, 0, 3, 16, 119, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15358, 12, 0, 3, 16, 119, height, 12, 0, height); + metal_a_supports_paint_setup(9, 0, 0, height - 8, gTrackColours[SCHEME_TRACK]); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15366, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15353, 10, 16, 4, 16, 119, height, 10, 16, height); + metal_a_supports_paint_setup(7, 2, 0, height - 8, gTrackColours[SCHEME_TRACK]); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15365, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15361, 16, 16, 2, 16, 119, height, 16, 16, height); + metal_a_supports_paint_setup(8, 3, 0, height - 8, gTrackColours[SCHEME_TRACK]); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15367, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15351, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15359, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15352, 0, 16, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15360, 0, 16, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15352, 0, 16, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15360, 0, 16, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15351, 0, 0, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15359, 0, 0, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15353, 10, 16, 4, 16, 119, height, 10, 16, height); + metal_a_supports_paint_setup(7, 2, 0, height - 8, gTrackColours[SCHEME_TRACK]); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15365, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15361, 16, 16, 2, 16, 119, height, 16, 16, height); + metal_a_supports_paint_setup(8, 3, 0, height - 8, gTrackColours[SCHEME_TRACK]); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15367, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15350, 16, 0, 3, 16, 119, height, 16, 0, height); + metal_a_supports_paint_setup(6, 1, 0, height - 8, gTrackColours[SCHEME_TRACK]); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15364, 16, 0, 3, 16, 119, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15358, 12, 0, 3, 16, 119, height, 12, 0, height); + metal_a_supports_paint_setup(9, 0, 0, height - 8, gTrackColours[SCHEME_TRACK]); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15366, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15354, 0, 6, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15362, 0, 6, 32, 26, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15349, 0, 0, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15357, 0, 14, 32, 2, 63, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15355, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15363, 0, 6, 32, 20, 7, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15348, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15356, 0, 6, 32, 20, 3, height); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void looping_rc_track_right_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15383, 0, 6, 32, 20, 7, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15375, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15376, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15368, 0, 6, 32, 20, 3, height); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15382, 0, 6, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15374, 0, 6, 32, 26, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15377, 0, 14, 32, 2, 63, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15369, 0, 0, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15381, 16, 16, 2, 16, 119, height, 16, 16, height); + metal_a_supports_paint_setup(7, 3, 0, height - 8, gTrackColours[SCHEME_TRACK]); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15384, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15373, 10, 16, 4, 16, 119, height, 10, 16, height); + metal_a_supports_paint_setup(8, 1, 0, height - 8, gTrackColours[SCHEME_TRACK]); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15386, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15378, 12, 0, 3, 16, 119, height, 12, 0, height); + metal_a_supports_paint_setup(6, 0, 0, height - 8, gTrackColours[SCHEME_TRACK]); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15385, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15370, 16, 0, 2, 16, 119, height, 16, 0, height); + metal_a_supports_paint_setup(9, 2, 0, height - 8, gTrackColours[SCHEME_TRACK]); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15387, 16, 0, 2, 16, 119, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15380, 0, 16, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15372, 0, 16, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15379, 0, 0, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15371, 0, 0, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15379, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15371, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15380, 0, 16, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15372, 0, 16, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15378, 12, 0, 3, 16, 119, height, 12, 0, height); + metal_a_supports_paint_setup(6, 0, 0, height - 8, gTrackColours[SCHEME_TRACK]); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15385, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15370, 16, 0, 2, 16, 119, height, 16, 0, height); + metal_a_supports_paint_setup(9, 2, 0, height - 8, gTrackColours[SCHEME_TRACK]); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15387, 16, 0, 2, 16, 119, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15381, 16, 16, 2, 16, 119, height, 16, 16, height); + metal_a_supports_paint_setup(7, 3, 0, height - 8, gTrackColours[SCHEME_TRACK]); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15384, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15373, 10, 16, 4, 16, 119, height, 10, 16, height); + metal_a_supports_paint_setup(8, 1, 0, height - 8, gTrackColours[SCHEME_TRACK]); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15386, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15377, 0, 14, 32, 2, 63, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15369, 0, 0, 32, 26, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15382, 0, 6, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15374, 0, 6, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15376, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15368, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15383, 0, 6, 32, 20, 7, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15375, 0, 6, 32, 20, 3, height); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void looping_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15125, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15128, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15131, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15122, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15124, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15127, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15130, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15121, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15123, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15126, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15129, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15120, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + looping_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void looping_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15137, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15144, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15140, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15143, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15134, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15136, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15139, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15142, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15133, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15135, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15138, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15141, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15145, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15132, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + looping_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void looping_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15327, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15329, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15331, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15325, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15326, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15328, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15330, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15324, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void looping_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15316, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15318, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15320, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15322, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15317, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15319, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15321, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15323, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void looping_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + looping_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void looping_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + looping_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void looping_rc_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15165, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15172, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15168, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15171, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15162, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15164, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15167, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15170, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15161, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15163, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15166, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15169, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15173, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15160, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15162, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15165, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15172, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15168, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15171, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15161, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15164, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15167, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15170, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15160, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15163, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15166, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15169, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15173, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15146, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15149, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15152, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15155, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15159, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15147, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15150, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15153, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15156, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15148, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15151, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15158, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15154, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15157, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15149, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15152, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15155, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15159, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15146, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15150, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15153, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15156, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15147, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15151, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15158, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15154, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15157, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15148, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + looping_rc_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void looping_rc_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + looping_rc_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void looping_rc_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15247, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15258, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15252, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15257, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15242, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15246, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15251, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15256, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15241, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15245, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15250, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15255, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15240, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15244, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15249, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15254, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15239, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15243, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15248, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15253, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15259, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15238, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15242, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15247, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15258, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15252, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15257, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15241, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15246, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15251, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15256, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15240, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15245, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15250, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15255, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15239, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15244, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15249, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15254, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15238, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15243, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15248, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15253, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15259, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15216, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15221, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15226, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15231, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15237, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15217, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15222, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15227, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15232, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15218, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15223, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15228, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15233, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15219, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15224, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15229, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15234, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15220, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15225, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15236, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15230, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15235, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15221, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15226, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15231, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15237, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15216, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15222, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15227, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15232, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15217, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15223, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15228, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15233, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15218, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15224, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15229, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15234, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15219, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15225, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15236, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15230, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15235, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15220, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + looping_rc_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void looping_rc_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + looping_rc_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void looping_rc_track_left_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15341, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15345, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15342, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15346, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15343, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15347, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15340, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15344, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_left(height - 8, TUNNEL_2); + break; + case 2: + paint_util_push_tunnel_right(height + 56, TUNNEL_1); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + paint_util_push_tunnel_left(height + 56, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void looping_rc_track_right_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15332, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15336, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15333, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15337, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15334, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15338, 0, 0, 2, 28, 59, height, 28, 2, height + 2); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15335, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15339, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 56, TUNNEL_1); + paint_util_push_tunnel_left(height - 8, TUNNEL_1); + break; + case 1: + paint_util_push_tunnel_left(height + 56, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void looping_rc_track_left_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_right_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void looping_rc_track_right_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_left_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void looping_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15012, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15014, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15013, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15015, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void looping_rc_track_25_deg_up_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15594, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15595, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15596, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15597, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void looping_rc_track_25_deg_up_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15598, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15599, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15600, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15601, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void looping_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15004, 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, gTrackColours[SCHEME_MISC] | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15005, 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, gTrackColours[SCHEME_MISC] | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15004, 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, gTrackColours[SCHEME_MISC] | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15005, 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); + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void looping_rc_track_25_deg_down_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_25_deg_up_right_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_25_deg_down_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_25_deg_up_left_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15526, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15530, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15534, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15538, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15527, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15531, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15535, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15539, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15528, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15532, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15536, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15540, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15529, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15533, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15537, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15541, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15510, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15514, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15518, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15522, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15511, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15515, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15519, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15523, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15512, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15516, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15520, 0, 0, 28, 28, 3, height, 4, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15524, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15513, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15517, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15521, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15525, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + looping_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + looping_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void looping_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15558, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15562, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15566, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15570, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15559, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15563, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15567, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15571, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15560, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15564, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15568, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15572, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15561, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15565, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15569, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15573, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15542, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15546, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15550, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15554, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15543, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15547, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15551, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15555, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15544, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15548, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15552, 0, 0, 28, 28, 0, height, 4, 4, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15556, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15545, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15549, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15553, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15557, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + looping_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + looping_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void looping_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15451, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15423, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15448, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15420, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15450, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15422, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15449, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15421, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15463, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15435, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15460, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15432, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15462, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15434, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15461, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15433, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void looping_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15475, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15447, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15472, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15444, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15474, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15446, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15473, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15445, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void looping_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15455, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15427, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15452, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15424, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15454, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15426, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15453, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15425, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void looping_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15467, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15439, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15464, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15436, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15466, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15438, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15465, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15437, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void looping_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15471, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15443, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15468, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15440, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15470, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15442, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15469, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(0, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15441, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(0, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void looping_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15459, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15431, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15456, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15428, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15458, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15430, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15457, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15429, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void looping_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15461, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15433, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15462, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15434, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15460, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15432, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15463, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15435, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void looping_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15473, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15445, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15474, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15446, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15472, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15444, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15475, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15447, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void looping_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15457, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15429, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15458, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15430, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15456, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15428, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15459, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15431, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void looping_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15469, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15441, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15470, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15442, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15468, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15440, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15471, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15443, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void looping_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15465, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15437, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15466, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15438, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15464, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15436, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15467, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15439, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void looping_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15453, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15425, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15454, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15426, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15452, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15424, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15455, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15427, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void looping_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15503, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15500, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15504, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15502, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15501, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15508, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15505, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15507, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15509, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15506, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15506, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15507, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15509, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15505, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15508, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15501, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15502, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15500, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15504, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15503, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15493, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15490, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15494, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15492, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15491, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void looping_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15498, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15495, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15497, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15499, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15496, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void looping_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15483, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15480, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15484, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15482, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15481, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void looping_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15488, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15485, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15487, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15489, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15486, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void looping_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15486, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15487, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15489, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15485, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15488, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void looping_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15481, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15482, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15480, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15484, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15483, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void looping_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15496, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15497, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15499, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15495, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15498, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void looping_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15491, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15492, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15490, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15494, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15493, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void looping_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15479, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15476, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15478, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15477, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15477, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15478, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15476, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15479, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void looping_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15012, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15014, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15013, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15015, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void looping_rc_track_left_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15689, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15691, 0, 6, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15693, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15687, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15688, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15690, 6, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15692, 6, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15686, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void looping_rc_track_right_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15678, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15680, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15682, 0, 6, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15684, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15679, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15681, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15683, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15685, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void looping_rc_track_left_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + looping_rc_track_right_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void looping_rc_track_right_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + looping_rc_track_left_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void looping_rc_track_left_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15658, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15663, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15668, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15673, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15659, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15664, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15669, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15674, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15660, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15665, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15670, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15675, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15661, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15666, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15671, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15676, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15662, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15667, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15672, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15677, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void looping_rc_track_right_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15638, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15643, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15648, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15653, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15639, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15644, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15649, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15654, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15640, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15645, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15650, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15655, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15641, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15646, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15651, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15656, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15642, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15647, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15652, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15657, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void looping_rc_track_left_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + looping_rc_track_right_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void looping_rc_track_right_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + looping_rc_track_left_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void looping_rc_track_25_deg_up_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15602, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15603, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15610, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15604, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15605, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void looping_rc_track_25_deg_up_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15606, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15607, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15608, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15611, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15609, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void looping_rc_track_left_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15612, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15613, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15620, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15614, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15615, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void looping_rc_track_right_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15616, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15617, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15618, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15621, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15619, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void looping_rc_track_25_deg_down_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_right_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_25_deg_down_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_left_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_left_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_25_deg_up_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_right_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_25_deg_up_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_left_banked_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15622, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15623, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15624, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15625, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void looping_rc_track_right_banked_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15626, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15627, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15628, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15629, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void looping_rc_track_left_banked_25_deg_up_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15630, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15631, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15632, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15633, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void looping_rc_track_right_banked_25_deg_up_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15634, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15635, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15636, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15637, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void looping_rc_track_left_banked_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_right_banked_25_deg_up_to_right_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_right_banked_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_left_banked_25_deg_up_to_left_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_left_banked_25_deg_down_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_right_banked_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_right_banked_25_deg_down_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_left_banked_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15574, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15575, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15582, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15576, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15577, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void looping_rc_track_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15578, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15579, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15580, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15583, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15581, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void looping_rc_track_left_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15584, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15585, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15592, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15586, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15587, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void looping_rc_track_right_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15588, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15589, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15590, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15593, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15591, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void looping_rc_track_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_right_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_left_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_left_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void looping_rc_track_right_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + looping_rc_track_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_looping_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return looping_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return looping_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return looping_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return looping_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return looping_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return looping_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return looping_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return looping_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return looping_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return looping_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return looping_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return looping_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return looping_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return looping_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return looping_rc_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return looping_rc_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return looping_rc_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return looping_rc_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return looping_rc_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return looping_rc_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return looping_rc_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return looping_rc_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return looping_rc_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return looping_rc_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return looping_rc_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return looping_rc_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return looping_rc_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return looping_rc_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return looping_rc_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return looping_rc_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return looping_rc_track_right_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: + return looping_rc_track_left_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: + return looping_rc_track_right_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return looping_rc_track_left_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return looping_rc_track_right_quarter_turn_5_25_deg_down; + case TRACK_ELEM_S_BEND_LEFT: + return looping_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return looping_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_VERTICAL_LOOP: + return looping_rc_track_left_vertical_loop; + case TRACK_ELEM_RIGHT_VERTICAL_LOOP: + return looping_rc_track_right_vertical_loop; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return looping_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return looping_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return looping_rc_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return looping_rc_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return looping_rc_track_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return looping_rc_track_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return looping_rc_track_left_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return looping_rc_track_right_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: + return looping_rc_track_left_half_banked_helix_up_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: + return looping_rc_track_right_half_banked_helix_up_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: + return looping_rc_track_left_half_banked_helix_down_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: + return looping_rc_track_right_half_banked_helix_down_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: + return looping_rc_track_left_half_banked_helix_up_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: + return looping_rc_track_right_half_banked_helix_up_large; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: + return looping_rc_track_left_half_banked_helix_down_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: + return looping_rc_track_right_half_banked_helix_down_large; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP: + return looping_rc_track_left_quarter_turn_1_60_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP: + return looping_rc_track_right_quarter_turn_1_60_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return looping_rc_track_left_quarter_turn_1_60_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return looping_rc_track_right_quarter_turn_1_60_deg_down; + case TRACK_ELEM_BRAKES: + return looping_rc_track_brakes; + case TRACK_ELEM_25_DEG_UP_LEFT_BANKED: + return looping_rc_track_25_deg_up_left_banked; + case TRACK_ELEM_25_DEG_UP_RIGHT_BANKED: + return looping_rc_track_25_deg_up_right_banked; + case TRACK_ELEM_ON_RIDE_PHOTO: + return looping_rc_track_on_ride_photo; + case TRACK_ELEM_25_DEG_DOWN_LEFT_BANKED: + return looping_rc_track_25_deg_down_left_banked; + case TRACK_ELEM_25_DEG_DOWN_RIGHT_BANKED: + return looping_rc_track_25_deg_down_right_banked; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return looping_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return looping_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return looping_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return looping_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + return looping_rc_track_left_eighth_bank_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + return looping_rc_track_right_eighth_bank_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + return looping_rc_track_left_eighth_bank_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + return looping_rc_track_right_eighth_bank_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return looping_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return looping_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP: + return looping_rc_track_diag_60_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return looping_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + return looping_rc_track_diag_25_deg_up_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + return looping_rc_track_diag_60_deg_up_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return looping_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return looping_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN: + return looping_rc_track_diag_60_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return looping_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + return looping_rc_track_diag_25_deg_down_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + return looping_rc_track_diag_60_deg_down_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return looping_rc_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + return looping_rc_track_diag_flat_to_left_bank; + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + return looping_rc_track_diag_flat_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + return looping_rc_track_diag_left_bank_to_flat; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + return looping_rc_track_diag_right_bank_to_flat; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + return looping_rc_track_diag_left_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + return looping_rc_track_diag_right_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + return looping_rc_track_diag_25_deg_up_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + return looping_rc_track_diag_25_deg_up_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + return looping_rc_track_diag_left_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + return looping_rc_track_diag_right_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + return looping_rc_track_diag_25_deg_down_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + return looping_rc_track_diag_25_deg_down_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK: + return looping_rc_track_diag_left_bank; + case TRACK_ELEM_DIAG_RIGHT_BANK: + return looping_rc_track_diag_right_bank; + case TRACK_ELEM_BLOCK_BRAKES: + return looping_rc_track_block_brakes; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return looping_rc_track_left_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return looping_rc_track_right_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return looping_rc_track_left_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return looping_rc_track_right_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return looping_rc_track_left_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return looping_rc_track_right_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return looping_rc_track_left_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return looping_rc_track_right_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANKED_25_DEG_UP: + return looping_rc_track_25_deg_up_to_left_banked_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANKED_25_DEG_UP: + return looping_rc_track_25_deg_up_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return looping_rc_track_left_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return looping_rc_track_right_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANKED_25_DEG_DOWN: + return looping_rc_track_25_deg_down_to_left_banked_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANKED_25_DEG_DOWN: + return looping_rc_track_25_deg_down_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return looping_rc_track_left_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return looping_rc_track_right_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return looping_rc_track_left_banked_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return looping_rc_track_right_banked_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_LEFT_BANKED_FLAT: + return looping_rc_track_left_banked_25_deg_up_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_RIGHT_BANKED_FLAT: + return looping_rc_track_right_banked_25_deg_up_to_right_banked_flat; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return looping_rc_track_left_banked_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return looping_rc_track_right_banked_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_LEFT_BANKED_FLAT: + return looping_rc_track_left_banked_25_deg_down_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_RIGHT_BANKED_FLAT: + return looping_rc_track_right_banked_25_deg_down_to_right_banked_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return looping_rc_track_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return looping_rc_track_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_FLAT: + return looping_rc_track_left_banked_25_deg_up_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_FLAT: + return looping_rc_track_right_banked_25_deg_up_to_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return looping_rc_track_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return looping_rc_track_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_FLAT: + return looping_rc_track_left_banked_25_deg_down_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_FLAT: + return looping_rc_track_right_banked_25_deg_down_to_flat; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 8c28f66d4c..c70ef77d80 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6256,7 +6256,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_launched_freefall, // RIDE_TYPE_LAUNCHED_FREEFALL get_track_paint_function_bobsleigh_rc, // RIDE_TYPE_BOBSLEIGH_COASTER get_track_paint_function_observation_tower, // RIDE_TYPE_OBSERVATION_TOWER - 0, // RIDE_TYPE_LOOPING_ROLLER_COASTER + get_track_paint_function_looping_rc, // RIDE_TYPE_LOOPING_ROLLER_COASTER get_track_paint_function_dinghy_slide, // RIDE_TYPE_DINGHY_SLIDE 0, // RIDE_TYPE_MINE_TRAIN_COASTER get_track_paint_function_chairlift, // RIDE_TYPE_CHAIRLIFT diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index ec0453a2c8..487be6817b 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -274,6 +274,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_car_ride(int trackType, int direct TRACK_PAINT_FUNCTION get_track_paint_function_launched_freefall(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_bobsleigh_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_observation_tower(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_looping_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_dinghy_slide(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_chairlift(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_maze(int trackType, int direction); From 5c421ed6a4ee36b0c952be6f1e473785d3fcb221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:33:00 +0200 Subject: [PATCH 10/55] Add generated Mine train RC --- src/ride/coaster/mine_train_coaster.c | 5525 +++++++++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 5527 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/mine_train_coaster.c b/src/ride/coaster/mine_train_coaster.c index 846fd9695d..9166e5d520 100644 --- a/src/ride/coaster/mine_train_coaster.c +++ b/src/ride/coaster/mine_train_coaster.c @@ -13,3 +13,5528 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void mine_train_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20054, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20055, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20056, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20057, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20052, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20053, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + 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 mine_train_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20102, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 9, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20103, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 10, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20104, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 11, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20105, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 12, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20074, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 9, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20075, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 10, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20076, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 11, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20077, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 12, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void mine_train_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20090, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 21, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20091, 0, 0, 1, 32, 98, height, 27, 0, height); + wooden_a_supports_paint_setup(7, 22, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20092, 0, 0, 1, 32, 98, height, 27, 0, height); + wooden_a_supports_paint_setup(6, 23, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20093, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 24, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void mine_train_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20094, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 1, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20095, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 2, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20096, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 3, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20097, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 4, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20066, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 1, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20067, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 2, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20068, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 3, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20069, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 4, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void mine_train_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20078, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 13, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20079, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20082, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 14, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20080, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20083, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 15, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20081, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 16, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void mine_train_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20084, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 17, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20085, 0, 0, 24, 1, 61, height, 4, 29, height - 16); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20088, 0, 0, 32, 2, 66, height, 0, 4, height); + wooden_a_supports_paint_setup(7, 18, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20086, 0, 0, 24, 1, 61, height, 4, 29, height - 16); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20089, 0, 0, 32, 2, 66, height, 0, 4, height); + wooden_a_supports_paint_setup(6, 19, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20087, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 20, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void mine_train_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20098, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 5, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20099, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 6, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20100, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 7, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20101, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 8, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20070, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 5, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20071, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 6, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20072, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 7, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20073, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 8, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void mine_train_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_train_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_train_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_train_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_train_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_train_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_train_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_train_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_train_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_train_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_train_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_train_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_train_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20155, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20160, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20165, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20150, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20154, 0, 0, 32, 16, 1, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20159, 0, 0, 32, 16, 1, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20164, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20149, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20153, 0, 0, 16, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20158, 0, 0, 16, 16, 1, height, 16, 16, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20163, 0, 0, 16, 16, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20148, 0, 0, 16, 16, 1, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20152, 0, 0, 16, 32, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20157, 0, 0, 16, 32, 1, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20162, 0, 0, 16, 32, 1, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20147, 0, 0, 16, 32, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20151, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20156, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20161, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20146, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mine_train_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mine_train_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20106, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20114, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20107, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20115, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20108, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20109, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + 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 mine_train_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20110, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20111, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20112, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20116, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20113, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20117, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + 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 mine_train_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20112, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20116, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20113, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20117, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20110, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20111, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + 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 mine_train_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20108, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20109, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20106, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20114, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20107, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20115, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + 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 mine_train_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20175, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20186, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20180, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20185, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20170, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20174, 0, 0, 32, 16, 1, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20179, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20184, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20169, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20173, 0, 0, 16, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20178, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20183, 0, 0, 16, 16, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20168, 0, 0, 16, 16, 1, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20172, 0, 0, 16, 32, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20177, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20182, 0, 0, 16, 32, 1, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20167, 0, 0, 16, 32, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20171, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20176, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20181, 0, 0, 20, 32, 1, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20187, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20166, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mine_train_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mine_train_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20118, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20122, 0, 0, 32, 1, 34, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 1, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20119, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20123, 0, 0, 32, 1, 34, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 2, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20120, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 3, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20121, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 4, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void mine_train_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20124, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 1, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20125, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 2, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20126, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20128, 0, 0, 32, 1, 34, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 3, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20127, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20129, 0, 0, 32, 1, 34, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 4, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void mine_train_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20130, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20134, 0, 0, 32, 1, 34, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 5, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20131, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20135, 0, 0, 32, 1, 34, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 6, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20132, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 7, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20133, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 8, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void mine_train_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20136, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 5, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20137, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 6, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20138, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20140, 0, 0, 32, 1, 34, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 7, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20139, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20141, 0, 0, 32, 1, 34, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 8, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void mine_train_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_train_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_train_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_train_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_train_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_train_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_train_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_train_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_train_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20142, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20143, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20144, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20145, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + 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 mine_train_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_train_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_train_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20250, 0, 0, 32, 27, 1, height, 0, 2, height); + wooden_a_supports_paint_setup(6, 9, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20255, 0, 0, 32, 27, 1, height, 0, 2, height); + wooden_a_supports_paint_setup(7, 10, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20260, 0, 0, 32, 27, 1, height, 0, 2, height); + wooden_a_supports_paint_setup(6, 11, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20265, 0, 0, 32, 27, 1, height, 0, 2, height); + wooden_a_supports_paint_setup(7, 12, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20251, 0, 0, 32, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20256, 0, 0, 32, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20261, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20266, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20252, 0, 0, 16, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20257, 0, 0, 16, 16, 1, height, 16, 16, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20262, 0, 0, 16, 16, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20267, 0, 0, 16, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20253, 0, 0, 16, 32, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20258, 0, 0, 16, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20263, 0, 0, 16, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20268, 0, 0, 16, 32, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20254, 0, 0, 27, 32, 1, height, 2, 0, height); + wooden_a_supports_paint_setup(7, 12, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20259, 0, 0, 27, 32, 1, height, 2, 0, height); + wooden_a_supports_paint_setup(6, 9, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20264, 0, 0, 27, 32, 1, height, 2, 0, height); + wooden_a_supports_paint_setup(7, 10, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20269, 0, 0, 27, 32, 1, height, 2, 0, height); + wooden_a_supports_paint_setup(6, 11, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mine_train_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20230, 0, 0, 32, 27, 1, height, 0, 2, height); + wooden_a_supports_paint_setup(6, 9, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20235, 0, 0, 32, 27, 1, height, 0, 2, height); + wooden_a_supports_paint_setup(7, 10, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20240, 0, 0, 32, 27, 1, height, 0, 2, height); + wooden_a_supports_paint_setup(6, 11, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20245, 0, 0, 32, 27, 1, height, 0, 2, height); + wooden_a_supports_paint_setup(7, 12, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20231, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20236, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20241, 0, 0, 32, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20246, 0, 0, 32, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20232, 0, 0, 16, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20237, 0, 0, 16, 16, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20242, 0, 0, 16, 16, 1, height, 16, 16, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20247, 0, 0, 16, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20233, 0, 0, 16, 32, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20238, 0, 0, 16, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20243, 0, 0, 16, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20248, 0, 0, 16, 32, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20234, 0, 0, 27, 32, 1, height, 2, 0, height); + wooden_a_supports_paint_setup(7, 10, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20239, 0, 0, 27, 32, 1, height, 2, 0, height); + wooden_a_supports_paint_setup(6, 11, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20244, 0, 0, 27, 32, 1, height, 2, 0, height); + wooden_a_supports_paint_setup(7, 12, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20249, 0, 0, 27, 32, 1, height, 2, 0, height); + wooden_a_supports_paint_setup(6, 9, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mine_train_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mine_train_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void mine_train_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mine_train_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mine_train_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20270, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20274, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20273, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20277, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20271, 0, 0, 32, 26, 1, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20275, 0, 0, 32, 26, 1, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20272, 0, 0, 32, 26, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20276, 0, 0, 32, 26, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20272, 0, 0, 32, 26, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20276, 0, 0, 32, 26, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20271, 0, 0, 32, 26, 1, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20275, 0, 0, 32, 26, 1, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20273, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20277, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20270, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20274, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20278, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20282, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20281, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20285, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20279, 0, 0, 32, 26, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20283, 0, 0, 32, 26, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20280, 0, 0, 32, 26, 1, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20284, 0, 0, 32, 26, 1, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20280, 0, 0, 32, 26, 1, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20284, 0, 0, 32, 26, 1, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20279, 0, 0, 32, 26, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20283, 0, 0, 32, 26, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20281, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20285, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20278, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20282, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20193, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20196, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20199, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20190, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20192, 0, 0, 16, 16, 1, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20195, 0, 0, 16, 16, 1, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20198, 0, 0, 16, 16, 1, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20189, 0, 0, 16, 16, 1, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20191, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20194, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20197, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20188, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mine_train_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mine_train_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20205, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20212, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20208, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20211, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20202, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20204, 0, 0, 16, 16, 1, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20207, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20210, 0, 0, 16, 16, 1, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20201, 0, 0, 16, 16, 1, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20203, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20206, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20209, 0, 0, 20, 32, 1, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20213, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20200, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mine_train_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mine_train_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20225, 0, 6, 32, 20, 1, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20227, 0, 6, 32, 20, 1, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20229, 0, 6, 32, 20, 1, height); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20223, 0, 6, 32, 20, 1, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20224, 6, 0, 20, 32, 1, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20226, 6, 0, 20, 32, 1, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20228, 6, 0, 20, 32, 1, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20222, 6, 0, 20, 32, 1, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mine_train_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20214, 0, 6, 32, 20, 1, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20216, 0, 6, 32, 20, 1, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20218, 0, 6, 32, 20, 1, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20220, 0, 6, 32, 20, 1, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20215, 6, 0, 20, 32, 1, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20217, 6, 0, 20, 32, 1, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20219, 6, 0, 20, 32, 1, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20221, 6, 0, 20, 32, 1, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mine_train_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mine_train_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void mine_train_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mine_train_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mine_train_rc_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20305, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20312, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20308, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20311, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20302, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20304, 0, 0, 16, 16, 1, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20307, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20310, 0, 0, 16, 16, 1, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20301, 0, 0, 16, 16, 1, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20303, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20306, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20309, 0, 0, 20, 32, 1, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20313, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20300, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20302, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20305, 0, 0, 20, 32, 1, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20312, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20308, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20311, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20301, 0, 0, 16, 16, 1, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20304, 0, 0, 16, 16, 1, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20307, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20310, 0, 0, 16, 16, 1, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20300, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20303, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20306, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20309, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20313, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20286, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20289, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20292, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20295, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20299, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20287, 0, 0, 16, 16, 1, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20290, 0, 0, 16, 16, 1, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20293, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20296, 0, 0, 16, 16, 1, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20288, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20291, 0, 0, 20, 32, 1, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20298, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20294, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20297, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20289, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20292, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20295, 0, 0, 20, 32, 1, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20299, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20286, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20290, 0, 0, 16, 16, 1, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20293, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20296, 0, 0, 16, 16, 1, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20287, 0, 0, 16, 16, 1, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20291, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20298, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20294, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20297, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20288, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mine_train_rc_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void mine_train_rc_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mine_train_rc_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mine_train_rc_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20345, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20356, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20350, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20355, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20340, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20344, 0, 0, 32, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20349, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20354, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20339, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20343, 0, 0, 16, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20348, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20178, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20353, 0, 0, 16, 16, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20338, 0, 0, 16, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20342, 0, 0, 16, 32, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20347, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20177, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20352, 0, 0, 16, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20337, 0, 0, 16, 32, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20341, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20346, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20351, 0, 0, 20, 32, 1, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20357, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20336, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20340, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20345, 0, 0, 20, 32, 1, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20356, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20350, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20355, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20339, 0, 0, 16, 32, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20344, 0, 0, 16, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20349, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20354, 0, 0, 16, 32, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20338, 0, 0, 16, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20343, 0, 0, 16, 16, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20348, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20178, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20353, 0, 0, 16, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20337, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20342, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20347, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20177, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20352, 0, 0, 32, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20336, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20341, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20346, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20351, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20357, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20314, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20319, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20324, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20329, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20335, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20315, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20320, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20325, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20330, 0, 0, 32, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20316, 0, 0, 16, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20321, 0, 0, 16, 16, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20326, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20331, 0, 0, 16, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20317, 0, 0, 16, 32, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20322, 0, 0, 16, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20327, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20332, 0, 0, 16, 32, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20318, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20323, 0, 0, 20, 32, 1, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20334, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20328, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20333, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20319, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20324, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20329, 0, 0, 20, 32, 1, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20335, 0, 0, 1, 32, 26, height, 27, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20314, 0, 0, 20, 32, 1, height, 6, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20320, 0, 0, 16, 32, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20325, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20330, 0, 0, 16, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20315, 0, 0, 16, 32, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20321, 0, 0, 16, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20326, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20331, 0, 0, 16, 16, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20316, 0, 0, 16, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20322, 0, 0, 32, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20327, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20332, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20317, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20323, 0, 0, 32, 20, 1, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20334, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20328, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20333, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20318, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mine_train_rc_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void mine_train_rc_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mine_train_rc_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mine_train_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20058, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20059, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + 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 mine_train_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20052, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25623, 26, 0, 1, 1, 19, height + 2); + sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25623, 26, 31, 1, 1, 19, height + 2); + sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25617, 6, 0, 1, 1, 19, height + 2); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20053, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25624, 6, 0, 1, 1, 19, height + 2); + sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25624, 6, 31, 1, 1, 19, height + 2); + sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25618, 26, 0, 1, 1, 19, height + 2); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20052, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25625, 6, 0, 1, 1, 19, height + 2); + sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25625, 6, 31, 1, 1, 19, height + 2); + sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25615, 26, 31, 1, 1, 19, height + 2); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20053, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25626, 26, 0, 1, 1, 19, height + 2); + sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25626, 26, 31, 1, 1, 19, height + 2); + sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25616, 6, 31, 1, 1, 19, height + 2); + break; + } + 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); +} + +static void mine_train_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20452, 0, 0, 32, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20456, 0, 0, 32, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20460, 0, 0, 32, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20464, 0, 0, 32, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20453, 0, 0, 32, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20457, 0, 0, 34, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20461, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20465, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20454, 0, 0, 16, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20458, 0, 0, 16, 16, 1, height, 16, 16, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20462, 0, 0, 16, 16, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20466, 0, 0, 16, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20455, 0, 0, 16, 16, 1, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20459, 0, 0, 16, 18, 1, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20463, 0, 0, 16, 16, 1, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20467, 0, 0, 16, 16, 1, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20436, 0, 0, 32, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20440, 0, 0, 32, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20444, 0, 0, 32, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20448, 0, 0, 32, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20437, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20441, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20445, 0, 0, 34, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20449, 0, 0, 32, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20438, 0, 0, 16, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20442, 0, 0, 16, 16, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20446, 0, 0, 28, 28, 1, height, 4, 4, height); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20450, 0, 0, 16, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20439, 0, 0, 16, 16, 1, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20443, 0, 0, 16, 16, 1, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20447, 0, 0, 16, 18, 1, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20451, 0, 0, 16, 16, 1, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + mine_train_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_train_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + mine_train_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void mine_train_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20484, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20488, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20492, 0, 0, 32, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20496, 0, 0, 32, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20485, 0, 0, 32, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20489, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20493, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20497, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20486, 0, 0, 16, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20490, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20494, 0, 0, 16, 16, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20498, 0, 0, 16, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20487, 0, 0, 16, 16, 1, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20491, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20495, 0, 0, 16, 16, 1, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20499, 0, 0, 16, 16, 1, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20468, 0, 0, 32, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20472, 0, 0, 32, 32, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20476, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20480, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20469, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20473, 0, 0, 32, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20477, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20481, 0, 0, 32, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20470, 0, 0, 16, 16, 1, height, 0, 0, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20474, 0, 0, 16, 16, 1, height, 16, 0, height); + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20478, 0, 0, 28, 28, 0, height, 4, 4, height + 27); + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20482, 0, 0, 16, 16, 1, height, 0, 16, height); + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20471, 0, 0, 16, 16, 1, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20475, 0, 0, 16, 16, 1, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20479, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20483, 0, 0, 16, 16, 1, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + mine_train_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_train_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + mine_train_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void mine_train_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20389, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20361, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20386, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20358, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20388, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20360, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20387, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20359, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20401, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20373, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20398, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20370, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20400, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20372, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20399, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20371, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20385, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20382, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20384, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20383, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20393, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20365, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20390, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20362, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20392, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20364, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20391, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20363, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20377, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20374, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20376, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20375, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20381, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20378, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20380, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20379, -16, -16, 16, 16, 1, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20397, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20369, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20394, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20366, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20396, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20368, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20395, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20367, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20399, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20371, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20400, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20372, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20398, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20370, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20401, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20373, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20383, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20384, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20382, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20385, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20395, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20367, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20396, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20368, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20394, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20366, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20397, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20369, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20379, -16, -16, 16, 16, 1, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20380, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20378, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20381, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20375, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20376, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20374, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20377, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20391, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20363, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20392, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20364, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20390, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20362, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20393, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20365, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20409, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20406, -16, -16, 32, 32, 1, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20410, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20408, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20407, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20414, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20411, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20413, -16, -16, 32, 32, 1, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20415, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20412, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20412, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20413, -16, -16, 32, 32, 1, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20415, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20411, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20414, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20407, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20408, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20406, -16, -16, 32, 32, 1, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20410, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20409, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20429, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20426, -16, -16, 32, 32, 1, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20430, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20428, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20427, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20434, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20431, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20433, -16, -16, 32, 32, 1, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20435, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20432, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20419, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20416, -16, -16, 32, 32, 1, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20420, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20418, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20417, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20424, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20421, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20423, -16, -16, 32, 32, 1, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20425, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20422, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20422, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20423, -16, -16, 32, 32, 1, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20425, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20421, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20424, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20417, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20418, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20416, -16, -16, 32, 32, 1, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20420, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(8, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20419, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20432, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20433, -16, -16, 32, 32, 1, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20435, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20431, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20434, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20427, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20428, -16, -16, 32, 32, 1, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20426, -16, -16, 32, 32, 1, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20430, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20429, -16, -16, 32, 32, 1, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20405, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20402, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20404, -16, -16, 32, 32, 3, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20403, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20403, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20404, -16, -16, 32, 32, 3, height, -16, -16, height); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(10, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(11, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20402, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + wooden_a_supports_paint_setup(8, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(9, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20405, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_train_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20060, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20061, 0, 0, 32, 20, 1, height, 0, 6, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + 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); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_mine_train_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return mine_train_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return mine_train_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return mine_train_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return mine_train_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return mine_train_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return mine_train_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return mine_train_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return mine_train_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return mine_train_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return mine_train_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return mine_train_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return mine_train_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return mine_train_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return mine_train_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return mine_train_rc_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return mine_train_rc_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return mine_train_rc_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return mine_train_rc_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return mine_train_rc_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return mine_train_rc_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return mine_train_rc_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return mine_train_rc_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return mine_train_rc_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return mine_train_rc_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return mine_train_rc_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return mine_train_rc_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return mine_train_rc_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return mine_train_rc_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return mine_train_rc_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return mine_train_rc_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return mine_train_rc_track_right_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: + return mine_train_rc_track_left_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: + return mine_train_rc_track_right_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return mine_train_rc_track_left_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return mine_train_rc_track_right_quarter_turn_5_25_deg_down; + case TRACK_ELEM_S_BEND_LEFT: + return mine_train_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return mine_train_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return mine_train_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return mine_train_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return mine_train_rc_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return mine_train_rc_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return mine_train_rc_track_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return mine_train_rc_track_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return mine_train_rc_track_left_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return mine_train_rc_track_right_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: + return mine_train_rc_track_left_half_banked_helix_up_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: + return mine_train_rc_track_right_half_banked_helix_up_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: + return mine_train_rc_track_left_half_banked_helix_down_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: + return mine_train_rc_track_right_half_banked_helix_down_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: + return mine_train_rc_track_left_half_banked_helix_up_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: + return mine_train_rc_track_right_half_banked_helix_up_large; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: + return mine_train_rc_track_left_half_banked_helix_down_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: + return mine_train_rc_track_right_half_banked_helix_down_large; + case TRACK_ELEM_BRAKES: + return mine_train_rc_track_brakes; + case TRACK_ELEM_ON_RIDE_PHOTO: + return mine_train_rc_track_on_ride_photo; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return mine_train_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return mine_train_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return mine_train_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return mine_train_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + return mine_train_rc_track_left_eighth_bank_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + return mine_train_rc_track_right_eighth_bank_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + return mine_train_rc_track_left_eighth_bank_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + return mine_train_rc_track_right_eighth_bank_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return mine_train_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return mine_train_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP: + return mine_train_rc_track_diag_60_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return mine_train_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + return mine_train_rc_track_diag_25_deg_up_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + return mine_train_rc_track_diag_60_deg_up_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return mine_train_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return mine_train_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN: + return mine_train_rc_track_diag_60_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return mine_train_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + return mine_train_rc_track_diag_25_deg_down_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + return mine_train_rc_track_diag_60_deg_down_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return mine_train_rc_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + return mine_train_rc_track_diag_flat_to_left_bank; + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + return mine_train_rc_track_diag_flat_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + return mine_train_rc_track_diag_left_bank_to_flat; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + return mine_train_rc_track_diag_right_bank_to_flat; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + return mine_train_rc_track_diag_left_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + return mine_train_rc_track_diag_right_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + return mine_train_rc_track_diag_25_deg_up_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + return mine_train_rc_track_diag_25_deg_up_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + return mine_train_rc_track_diag_left_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + return mine_train_rc_track_diag_right_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + return mine_train_rc_track_diag_25_deg_down_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + return mine_train_rc_track_diag_25_deg_down_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK: + return mine_train_rc_track_diag_left_bank; + case TRACK_ELEM_DIAG_RIGHT_BANK: + return mine_train_rc_track_diag_right_bank; + case TRACK_ELEM_BLOCK_BRAKES: + return mine_train_rc_track_block_brakes; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index c70ef77d80..47adbcd388 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6258,7 +6258,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_observation_tower, // RIDE_TYPE_OBSERVATION_TOWER get_track_paint_function_looping_rc, // RIDE_TYPE_LOOPING_ROLLER_COASTER get_track_paint_function_dinghy_slide, // RIDE_TYPE_DINGHY_SLIDE - 0, // RIDE_TYPE_MINE_TRAIN_COASTER + get_track_paint_function_mine_train_rc, // RIDE_TYPE_MINE_TRAIN_COASTER get_track_paint_function_chairlift, // RIDE_TYPE_CHAIRLIFT 0, // RIDE_TYPE_CORKSCREW_ROLLER_COASTER get_track_paint_function_maze, // RIDE_TYPE_MAZE diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 487be6817b..18f6978dca 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -276,6 +276,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_bobsleigh_rc(int trackType, int di TRACK_PAINT_FUNCTION get_track_paint_function_observation_tower(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_looping_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_dinghy_slide(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_mine_train_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_chairlift(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_maze(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_spiral_slide(int trackType, int direction); From 1d3c113439e94cefffaf592e9503cb33e4655319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:34:11 +0200 Subject: [PATCH 11/55] Add generated Corkscrew RC --- src/ride/coaster/corkscrew_roller_coaster.c | 5974 +++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 5976 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/corkscrew_roller_coaster.c b/src/ride/coaster/corkscrew_roller_coaster.c index 846fd9695d..686d414727 100644 --- a/src/ride/coaster/corkscrew_roller_coaster.c +++ b/src/ride/coaster/corkscrew_roller_coaster.c @@ -13,3 +13,5977 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void corkscrew_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16226, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16227, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16228, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16229, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16224, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16225, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void corkscrew_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16314, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16315, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16316, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16317, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16286, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16287, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16288, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16289, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void corkscrew_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16330, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16331, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16332, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16333, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16302, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16303, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16304, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16305, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void corkscrew_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16306, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16307, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16308, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16309, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16278, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16279, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16280, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16281, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void corkscrew_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16318, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16319, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16322, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16320, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16323, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16321, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16290, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16291, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16294, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16292, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16295, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16293, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void corkscrew_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16324, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16325, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16328, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16326, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16329, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16327, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16296, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16297, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16300, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16298, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16301, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16299, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void corkscrew_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16310, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16311, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16312, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16313, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16282, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16283, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16284, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16285, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void corkscrew_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void corkscrew_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void corkscrew_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void corkscrew_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void corkscrew_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void corkscrew_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void corkscrew_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16343, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16348, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16353, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16338, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16342, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16347, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16352, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16337, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16341, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16346, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16351, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16336, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16340, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16345, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16350, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16335, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16339, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16344, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16349, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16334, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + corkscrew_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void corkscrew_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16238, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16246, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16239, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16247, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16240, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16241, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void corkscrew_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16242, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16243, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16244, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16248, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16245, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16249, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void corkscrew_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16244, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16248, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16245, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16249, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16242, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16243, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void corkscrew_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16240, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16241, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16238, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16246, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16239, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16247, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void corkscrew_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16363, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16374, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16368, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16373, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16358, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16362, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16367, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16372, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16357, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16361, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16366, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16371, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16356, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16360, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16365, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16370, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16355, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16359, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16364, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16369, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16375, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16354, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + corkscrew_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void corkscrew_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16250, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16254, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16251, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16255, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16252, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16253, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void corkscrew_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16256, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16257, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16258, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16260, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16259, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16261, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void corkscrew_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16262, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16266, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16263, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16267, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16264, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16265, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void corkscrew_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16268, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16269, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16270, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16272, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16271, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16273, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void corkscrew_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void corkscrew_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void corkscrew_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void corkscrew_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void corkscrew_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16274, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16275, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16276, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16277, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void corkscrew_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void corkscrew_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16510, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16515, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16520, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16525, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16511, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16516, 0, 0, 32, 16, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16521, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16526, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16512, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16517, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16522, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16527, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16513, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16518, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16523, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16528, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16514, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16519, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16524, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16529, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void corkscrew_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16490, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16495, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16500, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16505, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16491, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16496, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16501, 0, 0, 32, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16506, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16492, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16497, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16502, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16507, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16493, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16498, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16503, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16508, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16494, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16499, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16504, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16509, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void corkscrew_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + corkscrew_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void corkscrew_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + corkscrew_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void corkscrew_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16402, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16406, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16405, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16409, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16403, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16407, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16404, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16408, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16404, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16408, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16403, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16407, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16405, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16409, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16402, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16406, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16410, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16414, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16413, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16417, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16411, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16415, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16412, 0, 0, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16416, 0, 0, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16412, 0, 0, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16416, 0, 0, 32, 26, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16411, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16415, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16413, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16417, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16410, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16414, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_left_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16562, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16570, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16569, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16577, 0, 6, 32, 20, 7, height); + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16563, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16571, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(0, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16568, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16576, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16564, 16, 0, 3, 16, 119, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16572, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16567, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16575, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16565, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16573, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16566, 0, 16, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16574, 0, 16, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16566, 0, 16, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16574, 0, 16, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16565, 0, 0, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16573, 0, 0, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16567, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16575, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16564, 16, 0, 3, 16, 119, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16572, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16568, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16576, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16563, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16571, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(0, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16569, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16577, 0, 6, 32, 20, 7, height); + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16562, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16570, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void corkscrew_rc_track_right_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16593, 0, 6, 32, 20, 7, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16585, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16586, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16578, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16592, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16584, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16587, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16579, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16591, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16583, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16588, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16580, 16, 0, 2, 16, 119, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16590, 0, 16, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16582, 0, 16, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16589, 0, 0, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16581, 0, 0, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16589, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16581, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16590, 0, 16, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16582, 0, 16, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16588, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16580, 16, 0, 2, 16, 119, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16591, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16583, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16587, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16579, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16592, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16584, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16586, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16578, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16593, 0, 6, 32, 20, 7, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16585, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void corkscrew_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16381, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16384, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16387, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16378, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16380, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16383, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16386, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16377, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16379, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16382, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16385, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16376, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + corkscrew_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void corkscrew_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16393, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16400, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16396, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16399, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16390, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16392, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16395, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16398, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16389, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16391, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16394, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16397, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16401, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16388, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + corkscrew_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void corkscrew_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16541, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16543, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16545, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16539, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16540, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16542, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16544, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16538, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void corkscrew_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16530, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16532, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16534, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16536, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16531, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16533, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16535, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16537, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void corkscrew_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + corkscrew_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void corkscrew_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + corkscrew_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void corkscrew_rc_track_half_loop_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16594, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16602, 0, 6, 32, 20, 11, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16601, 0, 6, 32, 20, 9, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16609, 0, 6, 32, 20, 7, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16595, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16603, 0, 14, 3, 20, 63, height, 28, 6, height); + metal_a_supports_paint_setup(0, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16600, 0, 6, 3, 20, 63, height, 28, 6, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16608, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16596, 16, 0, 2, 16, 119, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16604, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16599, 10, 16, 4, 12, 119, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16607, 16, 16, 2, 16, 119, height, 15, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16597, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16605, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16598, 0, 16, 32, 12, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16606, 0, 16, 32, 12, 3, height + 32); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void corkscrew_rc_track_half_loop_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_half_loop_up(rideIndex, 3 - trackSequence, direction, height, mapElement); +} + +static void corkscrew_rc_track_left_corkscrew_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16610, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16613, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16616, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16619, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16611, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16614, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16617, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16620, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16612, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16615, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16618, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16621, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 35, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void corkscrew_rc_track_right_corkscrew_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16622, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16625, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16628, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16631, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16623, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16626, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16629, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16632, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16624, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16627, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16630, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16633, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 35, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void corkscrew_rc_track_left_corkscrew_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_right_corkscrew_up(rideIndex, 2 - trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void corkscrew_rc_track_right_corkscrew_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_left_corkscrew_up(rideIndex, 2 - trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void corkscrew_rc_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16481, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16488, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16484, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16487, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16478, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16480, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16483, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16486, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16477, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16479, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16482, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16485, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16489, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16476, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16478, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16481, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16488, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16484, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16487, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16477, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16480, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16483, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16486, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16476, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16479, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16482, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16485, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16489, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16462, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16465, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16468, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16471, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16475, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16463, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16466, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16469, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16472, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16464, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16467, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16474, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16470, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16473, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16465, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16468, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16471, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16475, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16462, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16466, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16469, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16472, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16463, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16467, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16474, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16470, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16473, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16464, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + corkscrew_rc_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void corkscrew_rc_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + corkscrew_rc_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void corkscrew_rc_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16449, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16460, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16454, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16459, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16444, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16448, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16453, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16458, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16443, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16447, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16452, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16457, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16442, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16446, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16451, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16456, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16441, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16445, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16450, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16455, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16461, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16440, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16444, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16449, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16460, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16454, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16459, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16443, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16448, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16453, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16458, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16442, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16447, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16452, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16457, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16441, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16446, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16451, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16456, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16440, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16445, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16450, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16455, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16461, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16418, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16423, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16428, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16433, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16439, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16419, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16424, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16429, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16434, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16420, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16425, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16430, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16435, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16421, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16426, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16431, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16436, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16422, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16427, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16438, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16432, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16437, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16423, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16428, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16433, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16439, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16418, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16424, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16429, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16434, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16419, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16425, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16430, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16435, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16420, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16426, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16431, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16436, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16421, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16427, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16438, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16432, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16437, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16422, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + corkscrew_rc_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void corkscrew_rc_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + corkscrew_rc_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void corkscrew_rc_track_left_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16555, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16559, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16556, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16560, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16557, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16561, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16554, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16558, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_left(height - 8, TUNNEL_2); + break; + case 2: + paint_util_push_tunnel_right(height + 56, TUNNEL_1); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + paint_util_push_tunnel_left(height + 56, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void corkscrew_rc_track_right_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16546, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16550, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16547, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16551, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16548, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16552, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16549, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16553, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 56, TUNNEL_1); + paint_util_push_tunnel_left(height - 8, TUNNEL_1); + break; + case 1: + paint_util_push_tunnel_left(height + 56, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void corkscrew_rc_track_left_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_right_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void corkscrew_rc_track_right_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_left_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void corkscrew_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16230, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16231, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void corkscrew_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, 0x20000000 | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16224, 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(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16225, 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(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16224, 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(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16225, 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); + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void corkscrew_rc_track_flat_to_60_deg_up_long_base(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16788, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16792, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16796, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16800, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16789, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16793, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16797, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16801, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16790, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16794, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16798, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16802, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16791, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16795, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16799, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16803, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 18, height, gTrackColours[SCHEME_SUPPORTS]); + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height + 24, TUNNEL_8); + break; + case 2: + paint_util_push_tunnel_left(height + 24, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + } +} + +static void corkscrew_rc_track_60_deg_up_to_flat_long_base(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16804, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16808, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16812, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16816, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16805, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16809, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16813, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16817, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16806, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16810, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16814, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16818, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16807, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16811, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16815, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16819, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 5, height, gTrackColours[SCHEME_SUPPORTS]); + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); + break; + } +} + +static void corkscrew_rc_track_flat_to_60_deg_down_long_base(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_flat_to_60_deg_up_long_base(rideIndex, 3 - trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void corkscrew_rc_track_60_deg_up_to_flat_long_base122(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + corkscrew_rc_track_60_deg_up_to_flat_long_base(rideIndex, 3 - trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void corkscrew_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16740, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16744, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16748, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16752, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16741, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16745, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16749, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16753, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16742, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16746, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16750, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16754, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16743, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16747, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16751, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16755, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16724, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16728, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16732, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16736, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16725, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16729, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16733, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16737, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16726, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16730, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16734, 0, 0, 28, 28, 3, height, 4, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16738, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16727, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16731, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16735, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16739, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + corkscrew_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void corkscrew_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + corkscrew_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void corkscrew_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16772, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16776, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16780, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16784, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16773, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16777, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16781, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16785, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16774, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16778, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16782, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16786, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16775, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16779, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16783, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16787, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16756, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16760, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16764, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16768, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16757, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16761, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16765, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16769, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16758, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16762, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16766, 0, 0, 28, 28, 0, height, 4, 4, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16770, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16759, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16763, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16767, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16771, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + corkscrew_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void corkscrew_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + corkscrew_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void corkscrew_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16699, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16637, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16696, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16634, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16698, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16636, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16697, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16635, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16711, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16649, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16708, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16646, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16710, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16648, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16709, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16647, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16723, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16661, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16720, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16658, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16722, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16660, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16721, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16659, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16703, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16641, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16700, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16638, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16702, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16640, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16701, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16639, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16715, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16653, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16712, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16650, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16714, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16652, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16713, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16651, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16719, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16657, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16716, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16654, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16718, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16656, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16717, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(0, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16655, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(0, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16707, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16645, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16704, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16642, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16706, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16644, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16705, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16643, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16709, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16647, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16710, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16648, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16708, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16646, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16711, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16649, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16721, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16659, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16722, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16660, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16720, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16658, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16723, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16661, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16705, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16643, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16706, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16644, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16704, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16642, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16707, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16645, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16717, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16655, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16718, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16656, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16716, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16654, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16719, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16657, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16713, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16651, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16714, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16652, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16712, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16650, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16715, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16653, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16701, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16639, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16702, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16640, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16700, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16638, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16703, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16641, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16669, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16666, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16670, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16668, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16667, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16674, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16671, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16673, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16675, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16672, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16672, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16673, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16675, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16671, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16674, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16667, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16668, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16666, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16670, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16669, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16689, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16686, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16690, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16688, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16687, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16694, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16691, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16693, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16695, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16692, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16679, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16676, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16680, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16678, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16677, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16684, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16681, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16683, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16685, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16682, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16682, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16683, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16685, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16681, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16684, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16677, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16678, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16676, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16680, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16679, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16692, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16693, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16695, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16691, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16694, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16687, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16688, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16686, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16690, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16689, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16665, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16662, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16664, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16663, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16663, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16664, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16662, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16665, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void corkscrew_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16232, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16233, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_corkscrew_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return corkscrew_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return corkscrew_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return corkscrew_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return corkscrew_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return corkscrew_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return corkscrew_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return corkscrew_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return corkscrew_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return corkscrew_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return corkscrew_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return corkscrew_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return corkscrew_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return corkscrew_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return corkscrew_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return corkscrew_rc_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return corkscrew_rc_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return corkscrew_rc_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return corkscrew_rc_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return corkscrew_rc_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return corkscrew_rc_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return corkscrew_rc_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return corkscrew_rc_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return corkscrew_rc_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return corkscrew_rc_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return corkscrew_rc_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return corkscrew_rc_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return corkscrew_rc_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return corkscrew_rc_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return corkscrew_rc_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return corkscrew_rc_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return corkscrew_rc_track_right_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: + return corkscrew_rc_track_left_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: + return corkscrew_rc_track_right_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return corkscrew_rc_track_left_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return corkscrew_rc_track_right_quarter_turn_5_25_deg_down; + case TRACK_ELEM_S_BEND_LEFT: + return corkscrew_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return corkscrew_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_VERTICAL_LOOP: + return corkscrew_rc_track_left_vertical_loop; + case TRACK_ELEM_RIGHT_VERTICAL_LOOP: + return corkscrew_rc_track_right_vertical_loop; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return corkscrew_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return corkscrew_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return corkscrew_rc_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return corkscrew_rc_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return corkscrew_rc_track_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return corkscrew_rc_track_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return corkscrew_rc_track_left_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return corkscrew_rc_track_right_quarter_turn_3_25_deg_down; + case TRACK_ELEM_HALF_LOOP_UP: + return corkscrew_rc_track_half_loop_up; + case TRACK_ELEM_HALF_LOOP_DOWN: + return corkscrew_rc_track_half_loop_down; + case TRACK_ELEM_LEFT_CORKSCREW_UP: + return corkscrew_rc_track_left_corkscrew_up; + case TRACK_ELEM_RIGHT_CORKSCREW_UP: + return corkscrew_rc_track_right_corkscrew_up; + case TRACK_ELEM_LEFT_CORKSCREW_DOWN: + return corkscrew_rc_track_left_corkscrew_down; + case TRACK_ELEM_RIGHT_CORKSCREW_DOWN: + return corkscrew_rc_track_right_corkscrew_down; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: + return corkscrew_rc_track_left_half_banked_helix_up_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: + return corkscrew_rc_track_right_half_banked_helix_up_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: + return corkscrew_rc_track_left_half_banked_helix_down_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: + return corkscrew_rc_track_right_half_banked_helix_down_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: + return corkscrew_rc_track_left_half_banked_helix_up_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: + return corkscrew_rc_track_right_half_banked_helix_up_large; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: + return corkscrew_rc_track_left_half_banked_helix_down_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: + return corkscrew_rc_track_right_half_banked_helix_down_large; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP: + return corkscrew_rc_track_left_quarter_turn_1_60_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP: + return corkscrew_rc_track_right_quarter_turn_1_60_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return corkscrew_rc_track_left_quarter_turn_1_60_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return corkscrew_rc_track_right_quarter_turn_1_60_deg_down; + case TRACK_ELEM_BRAKES: + return corkscrew_rc_track_brakes; + case TRACK_ELEM_ON_RIDE_PHOTO: + return corkscrew_rc_track_on_ride_photo; + case TRACK_ELEM_FLAT_TO_60_DEG_UP_LONG_BASE: + return corkscrew_rc_track_flat_to_60_deg_up_long_base; + case TRACK_ELEM_60_DEG_UP_TO_FLAT_LONG_BASE: + return corkscrew_rc_track_60_deg_up_to_flat_long_base; + case TRACK_ELEM_FLAT_TO_60_DEG_DOWN_LONG_BASE: + return corkscrew_rc_track_flat_to_60_deg_down_long_base; + case TRACK_ELEM_60_DEG_UP_TO_FLAT_LONG_BASE_122: + return corkscrew_rc_track_60_deg_up_to_flat_long_base122; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return corkscrew_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return corkscrew_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return corkscrew_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return corkscrew_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + return corkscrew_rc_track_left_eighth_bank_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + return corkscrew_rc_track_right_eighth_bank_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + return corkscrew_rc_track_left_eighth_bank_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + return corkscrew_rc_track_right_eighth_bank_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return corkscrew_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return corkscrew_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP: + return corkscrew_rc_track_diag_60_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return corkscrew_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + return corkscrew_rc_track_diag_25_deg_up_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + return corkscrew_rc_track_diag_60_deg_up_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return corkscrew_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return corkscrew_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN: + return corkscrew_rc_track_diag_60_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return corkscrew_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + return corkscrew_rc_track_diag_25_deg_down_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + return corkscrew_rc_track_diag_60_deg_down_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return corkscrew_rc_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + return corkscrew_rc_track_diag_flat_to_left_bank; + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + return corkscrew_rc_track_diag_flat_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + return corkscrew_rc_track_diag_left_bank_to_flat; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + return corkscrew_rc_track_diag_right_bank_to_flat; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + return corkscrew_rc_track_diag_left_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + return corkscrew_rc_track_diag_right_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + return corkscrew_rc_track_diag_25_deg_up_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + return corkscrew_rc_track_diag_25_deg_up_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + return corkscrew_rc_track_diag_left_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + return corkscrew_rc_track_diag_right_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + return corkscrew_rc_track_diag_25_deg_down_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + return corkscrew_rc_track_diag_25_deg_down_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK: + return corkscrew_rc_track_diag_left_bank; + case TRACK_ELEM_DIAG_RIGHT_BANK: + return corkscrew_rc_track_diag_right_bank; + case TRACK_ELEM_BLOCK_BRAKES: + return corkscrew_rc_track_block_brakes; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 47adbcd388..b394b353f1 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6260,7 +6260,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_dinghy_slide, // RIDE_TYPE_DINGHY_SLIDE get_track_paint_function_mine_train_rc, // RIDE_TYPE_MINE_TRAIN_COASTER get_track_paint_function_chairlift, // RIDE_TYPE_CHAIRLIFT - 0, // RIDE_TYPE_CORKSCREW_ROLLER_COASTER + get_track_paint_function_corkscrew_rc, // RIDE_TYPE_CORKSCREW_ROLLER_COASTER get_track_paint_function_maze, // RIDE_TYPE_MAZE get_track_paint_function_spiral_slide, // RIDE_TYPE_SPIRAL_SLIDE get_track_paint_function_go_karts, // RIDE_TYPE_GO_KARTS diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 18f6978dca..534f0a2c02 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -278,6 +278,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_looping_rc(int trackType, int dire TRACK_PAINT_FUNCTION get_track_paint_function_dinghy_slide(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_mine_train_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_chairlift(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_corkscrew_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_maze(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_spiral_slide(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_go_karts(int trackType, int direction); From ef4a2f4106bf2de9f37d361fd313a0203be528e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:35:35 +0200 Subject: [PATCH 12/55] Add generated Vertical drop RC --- .../coaster/vertical_drop_roller_coaster.c | 7426 +++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 7428 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/vertical_drop_roller_coaster.c b/src/ride/coaster/vertical_drop_roller_coaster.c index 846fd9695d..51e160eb99 100644 --- a/src/ride/coaster/vertical_drop_roller_coaster.c +++ b/src/ride/coaster/vertical_drop_roller_coaster.c @@ -13,3 +13,7429 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void vertical_drop_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17486, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17487, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17488, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17489, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17146, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17147, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void vertical_drop_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17498, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17499, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17500, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17501, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17204, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17205, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17206, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17207, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void vertical_drop_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17514, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17515, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17516, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17517, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17220, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17221, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17222, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17223, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void vertical_drop_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17490, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17491, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17492, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17493, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17196, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17197, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17198, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17199, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void vertical_drop_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17502, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17503, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17506, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17504, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17507, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17505, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17208, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17209, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17212, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17210, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17213, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17211, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void vertical_drop_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17508, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17509, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17512, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17510, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17513, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17511, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17214, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17215, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17218, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17216, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17219, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17217, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void vertical_drop_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17494, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17495, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17496, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17497, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17200, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17201, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17202, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17203, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void vertical_drop_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17259, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17264, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17269, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17254, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17258, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17263, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17268, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17253, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17257, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17262, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17267, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17252, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17256, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17261, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17266, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17251, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17255, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17260, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17265, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17250, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + vertical_drop_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17156, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17164, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17157, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17165, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17158, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17159, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void vertical_drop_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17160, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17161, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17162, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17166, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17163, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17167, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void vertical_drop_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17162, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17166, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17163, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17167, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17160, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17161, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void vertical_drop_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17158, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17159, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17156, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17164, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17157, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17165, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void vertical_drop_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17279, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17290, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17284, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17289, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17274, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17278, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17283, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + metal_a_supports_paint_setup(3, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17288, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17273, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17277, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17282, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17287, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17272, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17276, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17281, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17286, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17271, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17275, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17280, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17285, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17291, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17270, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + vertical_drop_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17168, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17172, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17169, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17173, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17170, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17171, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void vertical_drop_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17174, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17175, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17176, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17178, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17177, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17179, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void vertical_drop_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17180, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17184, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17181, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17185, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17182, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17183, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void vertical_drop_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17186, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17187, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17188, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17190, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17189, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17191, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void vertical_drop_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17192, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17193, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17194, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17195, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void vertical_drop_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17344, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17349, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17354, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17359, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17345, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17350, 0, 0, 32, 16, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17355, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17360, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17346, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17351, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17356, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17361, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17347, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17352, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17357, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17362, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17348, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17353, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17358, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17363, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void vertical_drop_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17324, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17329, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17334, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17339, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17325, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17330, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17335, 0, 0, 32, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17340, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17326, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17331, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17336, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17341, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17327, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17332, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17337, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17342, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17328, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17333, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17338, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17343, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void vertical_drop_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + vertical_drop_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + vertical_drop_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17308, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17312, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17311, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17315, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17309, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(3, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17313, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(3, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17310, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17314, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17310, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17314, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17309, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(3, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17313, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(3, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17311, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17315, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17308, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17312, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17316, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17320, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17319, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17323, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17317, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(3, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17321, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(3, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17318, 0, 0, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17322, 0, 0, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17318, 0, 0, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17322, 0, 0, 32, 26, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17317, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(3, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17321, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(3, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17319, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17323, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17316, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17320, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_left_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17594, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17602, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17601, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17609, 0, 6, 32, 20, 7, height); + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17595, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(3, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17603, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(3, 4, 11, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17600, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(3, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17608, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(3, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17596, 16, 0, 3, 16, 119, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17604, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17599, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17607, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17597, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17605, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17598, 0, 16, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17606, 0, 16, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17598, 0, 16, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17606, 0, 16, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17597, 0, 0, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17605, 0, 0, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17599, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17607, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17596, 16, 0, 3, 16, 119, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17604, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17600, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(3, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17608, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(3, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17595, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(3, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17603, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(3, 4, 11, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17601, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17609, 0, 6, 32, 20, 7, height); + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17594, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17602, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_7); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_7); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void vertical_drop_rc_track_right_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17625, 0, 6, 32, 20, 7, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17617, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17618, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17610, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17624, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17616, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(3, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17619, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(3, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17611, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(3, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17623, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17615, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17620, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17612, 16, 0, 2, 16, 119, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17622, 0, 16, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17614, 0, 16, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17621, 0, 0, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17613, 0, 0, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17621, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17613, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17622, 0, 16, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17614, 0, 16, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17620, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17612, 16, 0, 2, 16, 119, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17623, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17615, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17619, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(3, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17611, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(3, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17624, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17616, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(3, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17618, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17610, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17625, 0, 6, 32, 20, 7, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17617, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_7); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_7); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void vertical_drop_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17229, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17232, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17235, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17226, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17228, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17231, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17234, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17225, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17227, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17230, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17233, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17224, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + vertical_drop_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17241, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17248, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17244, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17247, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17238, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17240, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17243, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17246, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17237, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17239, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17242, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17245, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17249, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17236, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + vertical_drop_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17375, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17377, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17379, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17373, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17374, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17376, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17378, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17372, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void vertical_drop_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17364, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17366, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17368, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17370, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17365, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17367, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17369, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(3, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17371, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void vertical_drop_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + vertical_drop_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + vertical_drop_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_flat_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17464, 0, 0, 32, 27, 4, height, 0, 2, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17465, 0, 0, 1, 24, 43, height, 29, 4, height + 2); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17468, 0, 0, 32, 2, 43, height, 0, 4, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17466, 0, 0, 1, 24, 43, height, 29, 4, height + 2); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17469, 0, 0, 32, 2, 43, height, 0, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17467, 0, 0, 32, 27, 4, height, 0, 2, height); + break; + } + metal_a_supports_paint_setup(3, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17452, 0, 0, 32, 27, 4, height, 0, 2, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17453, 0, 0, 1, 24, 43, height, 29, 4, height + 2); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17456, 0, 0, 32, 2, 43, height, 0, 4, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17454, 0, 0, 1, 24, 43, height, 29, 4, height + 2); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17457, 0, 0, 32, 2, 43, height, 0, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17455, 0, 0, 32, 27, 4, height, 0, 2, height); + break; + } + metal_a_supports_paint_setup(3, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void vertical_drop_rc_track_60_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17470, 0, 0, 32, 27, 4, height, 0, 2, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17471, 0, 0, 1, 24, 43, height, 29, 4, height + 2); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17474, 0, 0, 32, 2, 43, height, 0, 4, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17472, 0, 0, 1, 24, 43, height, 29, 4, height + 2); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17475, 0, 0, 32, 2, 43, height, 0, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17473, 0, 0, 32, 27, 4, height, 0, 2, height); + break; + } + metal_a_supports_paint_setup(3, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17458, 0, 0, 32, 27, 4, height, 0, 2, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17459, 0, 0, 1, 24, 43, height, 29, 4, height + 2); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17462, 0, 0, 32, 2, 43, height, 0, 4, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17460, 0, 0, 1, 24, 43, height, 29, 4, height + 2); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17463, 0, 0, 32, 2, 43, height, 0, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17461, 0, 0, 32, 27, 4, height, 0, 2, height); + break; + } + metal_a_supports_paint_setup(3, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void vertical_drop_rc_track_flat_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_60_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_60_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_flat_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17399, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17406, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17402, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17405, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17396, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17398, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17401, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17404, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17395, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17397, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17400, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17403, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17407, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17394, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17396, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17399, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17406, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17402, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17405, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(3, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17395, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17398, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17401, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17404, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17394, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17397, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17400, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17403, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17407, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17380, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17383, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17386, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17389, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17393, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(3, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17381, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17384, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17387, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17390, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17382, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17385, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17392, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17388, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17391, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17383, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17386, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17389, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17393, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17380, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(3, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17384, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17387, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17390, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17381, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17385, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17392, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17388, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17391, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17382, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + vertical_drop_rc_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + vertical_drop_rc_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17439, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17450, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17444, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17449, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17434, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17438, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17443, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17448, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17433, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17437, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17442, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17447, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17432, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17436, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17441, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17446, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17431, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17435, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17440, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17445, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17451, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17430, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(3, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17434, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17439, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17450, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17444, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17449, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(3, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17433, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17438, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17443, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17448, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17432, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17437, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17442, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17447, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17431, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17436, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17441, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17446, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17430, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17435, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17440, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17445, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17451, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(3, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17408, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17413, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17418, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17423, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17429, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(3, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17409, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17414, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17419, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17424, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17410, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17415, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17420, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17425, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17411, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17416, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17421, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17426, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17412, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(3, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17417, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17428, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(3, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17422, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(3, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17427, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(3, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17413, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17418, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17423, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17429, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17408, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(3, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17414, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17419, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17424, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17409, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17415, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17420, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17425, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17410, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17416, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17421, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17426, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17411, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17417, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17428, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(3, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17422, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(3, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17427, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(3, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17412, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(3, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + vertical_drop_rc_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + vertical_drop_rc_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_left_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17301, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17305, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17302, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17306, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17303, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17307, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17300, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17304, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_left(height - 8, TUNNEL_8); + break; + case 2: + paint_util_push_tunnel_right(height + 56, TUNNEL_7); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_7); + paint_util_push_tunnel_left(height + 56, TUNNEL_7); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void vertical_drop_rc_track_right_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17292, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17296, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17293, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17297, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17294, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17298, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17295, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17299, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 56, TUNNEL_7); + paint_util_push_tunnel_left(height - 8, TUNNEL_7); + break; + case 1: + paint_util_push_tunnel_left(height + 56, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_7); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void vertical_drop_rc_track_left_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_right_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_right_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_left_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17148, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17149, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void vertical_drop_rc_track_25_deg_up_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17914, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17915, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17916, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17917, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void vertical_drop_rc_track_25_deg_up_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17918, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17919, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17920, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17921, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void vertical_drop_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, 0x20000000 | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(3, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(3, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17146, 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(3, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(3, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17147, 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(3, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(3, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17146, 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(3, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(3, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17147, 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); + 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); +} + +static void vertical_drop_rc_track_25_deg_down_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_25_deg_up_right_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_25_deg_down_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_25_deg_up_left_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17526, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17527, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17528, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17529, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + } + paint_util_set_vertical_tunnel(height + 32); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + break; + } +} + +static void vertical_drop_rc_track_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_90_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_60_deg_up_to_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17518, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17519, 0, 0, 2, 20, 55, height, 24, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17520, 0, 0, 2, 20, 55, height, 24, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17521, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_vertical_tunnel(height + 48); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + break; + } +} + +static void vertical_drop_rc_track_90_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_60_deg_up_to_90_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_90_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17522, 0, 0, 32, 20, 3, height, 0, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17523, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17524, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17525, 0, 0, 32, 20, 3, height, 0, 6, height + 8); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height + 48, TUNNEL_8); + break; + case 2: + paint_util_push_tunnel_left(height + 48, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); +} + +static void vertical_drop_rc_track_60_deg_down_to_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17524, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17525, 0, 0, 32, 20, 3, height, 0, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17522, 0, 0, 32, 20, 3, height, 0, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17523, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 48, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 1: + break; + } +} + +static void vertical_drop_rc_track_brake_for_drop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17482, 0, 0, 1, 24, 43, height, 29, 4, height + 2); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17485, 0, 0, 32, 2, 43, height, 0, 4, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17483, 0, 0, 32, 27, 4, height, 0, 2, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17480, 0, 0, 32, 27, 4, height, 0, 2, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17481, 0, 0, 1, 24, 43, height, 29, 4, height + 2); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17484, 0, 0, 32, 2, 43, height, 0, 4, height); + break; + } + metal_a_supports_paint_setup(3, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void vertical_drop_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17546, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17550, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17554, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17558, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17547, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17551, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17555, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17559, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17548, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17552, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17556, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17560, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17549, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17553, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17557, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17561, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17530, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17534, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17538, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17542, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17531, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17535, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17539, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17543, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17532, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17536, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17540, 0, 0, 28, 28, 3, height, 4, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17544, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17533, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17537, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17541, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17545, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + vertical_drop_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + vertical_drop_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17578, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17582, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17586, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17590, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17579, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17583, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17587, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17591, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17580, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17584, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17588, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17592, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17581, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17585, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17589, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17593, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17562, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17566, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17570, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17574, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17563, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17567, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17571, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17575, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17564, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17568, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17572, 0, 0, 28, 28, 0, height, 4, 4, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17576, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17565, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17569, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17573, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17577, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + vertical_drop_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + vertical_drop_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17861, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17791, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17858, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17788, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17860, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17790, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17859, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17789, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17873, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17803, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17870, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17800, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17872, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17802, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17871, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17801, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17885, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17815, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17882, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17812, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17884, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17814, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17883, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17813, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17865, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17795, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17862, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17792, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17864, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17794, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17863, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17793, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17877, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17807, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17874, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17804, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17876, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17806, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17875, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17805, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17881, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17811, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17878, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17808, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17880, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17810, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17879, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(3, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17809, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(3, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17869, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17799, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17866, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17796, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17868, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17798, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17867, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17797, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17871, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17801, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17872, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17802, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17870, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17800, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17873, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17803, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17883, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17813, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17884, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17814, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17882, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17812, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17885, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17815, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17867, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17797, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17868, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17798, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17866, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17796, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17869, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17799, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17879, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17809, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17880, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17810, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17878, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17808, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17881, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17811, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17875, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17805, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17876, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17806, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17874, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17804, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17877, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17807, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17863, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17793, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17864, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17794, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17862, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17792, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17865, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17795, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_flat_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17889, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17819, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17886, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17816, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17888, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17818, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17887, -16, -16, 32, 32, 4, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17817, -16, -16, 32, 32, 4, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_60_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17893, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17823, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17890, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17820, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17892, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17822, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17891, -16, -16, 32, 32, 4, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17821, -16, -16, 32, 32, 4, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_flat_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17891, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17821, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17892, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17822, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17890, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17820, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17893, -16, -16, 32, 32, 4, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17823, -16, -16, 32, 32, 4, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_60_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17887, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17817, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17888, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17818, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17886, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17816, -16, -16, 32, 32, 4, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17889, -16, -16, 32, 32, 4, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17819, -16, -16, 32, 32, 4, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 5, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17831, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17828, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17832, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17830, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17829, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17836, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17833, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17835, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17837, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17834, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17834, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17835, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17837, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17833, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17836, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17829, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17830, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17828, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17832, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17831, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17851, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17848, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17852, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17850, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17849, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17856, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17853, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17855, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17857, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17854, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17841, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17838, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17842, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17840, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17839, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17846, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17843, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17845, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17847, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17844, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17844, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17845, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17847, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17843, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17846, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17839, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17840, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17838, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17842, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17841, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17854, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17855, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17857, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17853, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17856, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17849, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17850, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17848, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17852, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17851, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17827, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17824, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17826, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17825, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17825, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17826, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17824, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17827, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(3, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void vertical_drop_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17725, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17727, 0, 6, 32, 20, 3, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17731, 0, 6, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17729, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17723, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17724, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17726, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17728, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17722, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void vertical_drop_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17714, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17716, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17718, 0, 6, 32, 20, 3, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17730, 0, 6, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17720, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17715, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17717, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17719, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(3, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17721, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void vertical_drop_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17717, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17719, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(3, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17721, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17715, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17716, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17718, 6, 0, 20, 32, 3, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17730, 6, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17720, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17714, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void vertical_drop_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17722, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17724, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17726, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17728, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17723, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17725, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17727, 6, 0, 20, 32, 3, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17731, 6, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17729, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void vertical_drop_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17150, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17151, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void vertical_drop_rc_track_left_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18025, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18027, 0, 6, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18029, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18023, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18024, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18026, 6, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18028, 6, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18022, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void vertical_drop_rc_track_right_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18014, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18016, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18018, 0, 6, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18020, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18015, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18017, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18019, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(3, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18021, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void vertical_drop_rc_track_left_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + vertical_drop_rc_track_right_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_right_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + vertical_drop_rc_track_left_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_left_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17978, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17983, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17988, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17993, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17979, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17984, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17989, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17994, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17980, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17985, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17990, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17995, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17981, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17986, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17991, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17996, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17982, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17987, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17992, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17997, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void vertical_drop_rc_track_right_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17958, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17963, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17968, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17973, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17959, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17964, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17969, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17974, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17960, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17965, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17970, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17975, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17961, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17966, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17971, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17976, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17962, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17967, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17972, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17977, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void vertical_drop_rc_track_left_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + vertical_drop_rc_track_right_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_right_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + vertical_drop_rc_track_left_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_25_deg_up_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17922, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17923, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17930, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17924, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17925, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void vertical_drop_rc_track_25_deg_up_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17926, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17927, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17928, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17931, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17929, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void vertical_drop_rc_track_left_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17932, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17933, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17940, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17934, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17935, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void vertical_drop_rc_track_right_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17936, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17937, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17938, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17941, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17939, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void vertical_drop_rc_track_25_deg_down_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_right_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_25_deg_down_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_left_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_left_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_25_deg_up_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_right_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_25_deg_up_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_left_banked_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17942, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17943, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17944, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17945, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void vertical_drop_rc_track_right_banked_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17946, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17947, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17948, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17949, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void vertical_drop_rc_track_left_banked_25_deg_up_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17950, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17951, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17952, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17953, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void vertical_drop_rc_track_right_banked_25_deg_up_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17954, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17955, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17956, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17957, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void vertical_drop_rc_track_left_banked_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_right_banked_25_deg_up_to_right_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_right_banked_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_left_banked_25_deg_up_to_left_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_left_banked_25_deg_down_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_right_banked_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_right_banked_25_deg_down_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_left_banked_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17894, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17895, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17902, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17896, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17897, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void vertical_drop_rc_track_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17898, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17899, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17900, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17903, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17901, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void vertical_drop_rc_track_left_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17904, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17905, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17912, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17906, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17907, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void vertical_drop_rc_track_right_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17908, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17909, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17910, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17913, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17911, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void vertical_drop_rc_track_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_right_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_left_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_left_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_right_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_left_quarter_turn_1_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17998, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17999, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18007, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18008, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18001, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18009, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + } + paint_util_set_vertical_tunnel(height + 96); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 96, 0x20); + break; + case 1: + break; + } +} + +static void vertical_drop_rc_track_right_quarter_turn_1_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18002, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18010, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18011, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18004, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18012, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18005, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + break; + } + paint_util_set_vertical_tunnel(height + 96); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 96, 0x20); + break; + case 1: + break; + } +} + +static void vertical_drop_rc_track_left_quarter_turn_1_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_right_quarter_turn_1_90_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void vertical_drop_rc_track_right_quarter_turn_1_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + vertical_drop_rc_track_left_quarter_turn_1_90_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_vertical_drop_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return vertical_drop_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return vertical_drop_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return vertical_drop_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return vertical_drop_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return vertical_drop_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return vertical_drop_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return vertical_drop_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return vertical_drop_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return vertical_drop_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return vertical_drop_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return vertical_drop_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return vertical_drop_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return vertical_drop_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return vertical_drop_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return vertical_drop_rc_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return vertical_drop_rc_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return vertical_drop_rc_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return vertical_drop_rc_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return vertical_drop_rc_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return vertical_drop_rc_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return vertical_drop_rc_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return vertical_drop_rc_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return vertical_drop_rc_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return vertical_drop_rc_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return vertical_drop_rc_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return vertical_drop_rc_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return vertical_drop_rc_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return vertical_drop_rc_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return vertical_drop_rc_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return vertical_drop_rc_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return vertical_drop_rc_track_right_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: + return vertical_drop_rc_track_left_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: + return vertical_drop_rc_track_right_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return vertical_drop_rc_track_left_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return vertical_drop_rc_track_right_quarter_turn_5_25_deg_down; + case TRACK_ELEM_S_BEND_LEFT: + return vertical_drop_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return vertical_drop_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_VERTICAL_LOOP: + return vertical_drop_rc_track_left_vertical_loop; + case TRACK_ELEM_RIGHT_VERTICAL_LOOP: + return vertical_drop_rc_track_right_vertical_loop; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return vertical_drop_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return vertical_drop_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return vertical_drop_rc_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return vertical_drop_rc_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return vertical_drop_rc_track_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return vertical_drop_rc_track_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return vertical_drop_rc_track_left_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return vertical_drop_rc_track_right_quarter_turn_3_25_deg_down; + case TRACK_ELEM_FLAT_TO_60_DEG_UP: + return vertical_drop_rc_track_flat_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_FLAT: + return vertical_drop_rc_track_60_deg_up_to_flat; + case TRACK_ELEM_FLAT_TO_60_DEG_DOWN: + return vertical_drop_rc_track_flat_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_FLAT: + return vertical_drop_rc_track_60_deg_down_to_flat; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: + return vertical_drop_rc_track_left_half_banked_helix_up_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: + return vertical_drop_rc_track_right_half_banked_helix_up_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: + return vertical_drop_rc_track_left_half_banked_helix_down_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: + return vertical_drop_rc_track_right_half_banked_helix_down_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: + return vertical_drop_rc_track_left_half_banked_helix_up_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: + return vertical_drop_rc_track_right_half_banked_helix_up_large; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: + return vertical_drop_rc_track_left_half_banked_helix_down_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: + return vertical_drop_rc_track_right_half_banked_helix_down_large; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP: + return vertical_drop_rc_track_left_quarter_turn_1_60_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP: + return vertical_drop_rc_track_right_quarter_turn_1_60_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return vertical_drop_rc_track_left_quarter_turn_1_60_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return vertical_drop_rc_track_right_quarter_turn_1_60_deg_down; + case TRACK_ELEM_BRAKES: + return vertical_drop_rc_track_brakes; + case TRACK_ELEM_25_DEG_UP_LEFT_BANKED: + return vertical_drop_rc_track_25_deg_up_left_banked; + case TRACK_ELEM_25_DEG_UP_RIGHT_BANKED: + return vertical_drop_rc_track_25_deg_up_right_banked; + case TRACK_ELEM_ON_RIDE_PHOTO: + return vertical_drop_rc_track_on_ride_photo; + case TRACK_ELEM_25_DEG_DOWN_LEFT_BANKED: + return vertical_drop_rc_track_25_deg_down_left_banked; + case TRACK_ELEM_25_DEG_DOWN_RIGHT_BANKED: + return vertical_drop_rc_track_25_deg_down_right_banked; + case TRACK_ELEM_90_DEG_UP: + return vertical_drop_rc_track_90_deg_up; + case TRACK_ELEM_90_DEG_DOWN: + return vertical_drop_rc_track_90_deg_down; + case TRACK_ELEM_60_DEG_UP_TO_90_DEG_UP: + return vertical_drop_rc_track_60_deg_up_to_90_deg_up; + case TRACK_ELEM_90_DEG_DOWN_TO_60_DEG_DOWN: + return vertical_drop_rc_track_90_deg_down_to_60_deg_down; + case TRACK_ELEM_90_DEG_UP_TO_60_DEG_UP: + return vertical_drop_rc_track_90_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_DOWN_TO_90_DEG_DOWN: + return vertical_drop_rc_track_60_deg_down_to_90_deg_down; + case TRACK_ELEM_BRAKE_FOR_DROP: + return vertical_drop_rc_track_brake_for_drop; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return vertical_drop_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return vertical_drop_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return vertical_drop_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return vertical_drop_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + return vertical_drop_rc_track_left_eighth_bank_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + return vertical_drop_rc_track_right_eighth_bank_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + return vertical_drop_rc_track_left_eighth_bank_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + return vertical_drop_rc_track_right_eighth_bank_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return vertical_drop_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return vertical_drop_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP: + return vertical_drop_rc_track_diag_60_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return vertical_drop_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + return vertical_drop_rc_track_diag_25_deg_up_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + return vertical_drop_rc_track_diag_60_deg_up_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return vertical_drop_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return vertical_drop_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN: + return vertical_drop_rc_track_diag_60_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return vertical_drop_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + return vertical_drop_rc_track_diag_25_deg_down_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + return vertical_drop_rc_track_diag_60_deg_down_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return vertical_drop_rc_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_60_DEG_UP: + return vertical_drop_rc_track_diag_flat_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_FLAT: + return vertical_drop_rc_track_diag_60_deg_up_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_60_DEG_DOWN: + return vertical_drop_rc_track_diag_flat_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_FLAT: + return vertical_drop_rc_track_diag_60_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + return vertical_drop_rc_track_diag_flat_to_left_bank; + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + return vertical_drop_rc_track_diag_flat_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + return vertical_drop_rc_track_diag_left_bank_to_flat; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + return vertical_drop_rc_track_diag_right_bank_to_flat; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + return vertical_drop_rc_track_diag_left_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + return vertical_drop_rc_track_diag_right_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + return vertical_drop_rc_track_diag_25_deg_up_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + return vertical_drop_rc_track_diag_25_deg_up_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + return vertical_drop_rc_track_diag_left_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + return vertical_drop_rc_track_diag_right_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + return vertical_drop_rc_track_diag_25_deg_down_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + return vertical_drop_rc_track_diag_25_deg_down_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK: + return vertical_drop_rc_track_diag_left_bank; + case TRACK_ELEM_DIAG_RIGHT_BANK: + return vertical_drop_rc_track_diag_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return vertical_drop_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return vertical_drop_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN_TO_LEFT_BANK: + return vertical_drop_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_TO_RIGHT_BANK: + return vertical_drop_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank; + case TRACK_ELEM_BLOCK_BRAKES: + return vertical_drop_rc_track_block_brakes; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return vertical_drop_rc_track_left_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return vertical_drop_rc_track_right_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return vertical_drop_rc_track_left_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return vertical_drop_rc_track_right_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return vertical_drop_rc_track_left_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return vertical_drop_rc_track_right_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return vertical_drop_rc_track_left_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return vertical_drop_rc_track_right_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANKED_25_DEG_UP: + return vertical_drop_rc_track_25_deg_up_to_left_banked_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANKED_25_DEG_UP: + return vertical_drop_rc_track_25_deg_up_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return vertical_drop_rc_track_left_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return vertical_drop_rc_track_right_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANKED_25_DEG_DOWN: + return vertical_drop_rc_track_25_deg_down_to_left_banked_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANKED_25_DEG_DOWN: + return vertical_drop_rc_track_25_deg_down_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return vertical_drop_rc_track_left_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return vertical_drop_rc_track_right_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return vertical_drop_rc_track_left_banked_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return vertical_drop_rc_track_right_banked_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_LEFT_BANKED_FLAT: + return vertical_drop_rc_track_left_banked_25_deg_up_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_RIGHT_BANKED_FLAT: + return vertical_drop_rc_track_right_banked_25_deg_up_to_right_banked_flat; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return vertical_drop_rc_track_left_banked_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return vertical_drop_rc_track_right_banked_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_LEFT_BANKED_FLAT: + return vertical_drop_rc_track_left_banked_25_deg_down_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_RIGHT_BANKED_FLAT: + return vertical_drop_rc_track_right_banked_25_deg_down_to_right_banked_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return vertical_drop_rc_track_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return vertical_drop_rc_track_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_FLAT: + return vertical_drop_rc_track_left_banked_25_deg_up_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_FLAT: + return vertical_drop_rc_track_right_banked_25_deg_up_to_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return vertical_drop_rc_track_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return vertical_drop_rc_track_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_FLAT: + return vertical_drop_rc_track_left_banked_25_deg_down_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_FLAT: + return vertical_drop_rc_track_right_banked_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_90_DEG_UP: + return vertical_drop_rc_track_left_quarter_turn_1_90_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_90_DEG_UP: + return vertical_drop_rc_track_right_quarter_turn_1_90_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_90_DEG_DOWN: + return vertical_drop_rc_track_left_quarter_turn_1_90_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_90_DEG_DOWN: + return vertical_drop_rc_track_right_quarter_turn_1_90_deg_down; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index b394b353f1..e3b1aa6472 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6285,7 +6285,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_space_rings, // RIDE_TYPE_SPACE_RINGS get_track_paint_function_reverse_freefall_rc, // RIDE_TYPE_REVERSE_FREEFALL_COASTER get_track_paint_function_lift, // RIDE_TYPE_LIFT - 0, // RIDE_TYPE_VERTICAL_DROP_ROLLER_COASTER + get_track_paint_function_vertical_drop_rc, // RIDE_TYPE_VERTICAL_DROP_ROLLER_COASTER get_track_paint_function_shop, // RIDE_TYPE_CASH_MACHINE get_track_paint_function_twist, // RIDE_TYPE_TWIST get_track_paint_function_haunted_house, // RIDE_TYPE_HAUNTED_HOUSE diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 534f0a2c02..86b294ad22 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -294,6 +294,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_topspin(int trackType, int directi TRACK_PAINT_FUNCTION get_track_paint_function_space_rings(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_reverse_freefall_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_lift(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_vertical_drop_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_shop(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_merry_go_round(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_facility(int trackType, int direction); From c56936adb809671e575bd04497c253ed300bf922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:38:20 +0200 Subject: [PATCH 13/55] Add generated Twister RC --- src/ride/coaster/twister_roller_coaster.c | 7975 +++++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 7977 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/twister_roller_coaster.c b/src/ride/coaster/twister_roller_coaster.c index 846fd9695d..7e8c026836 100644 --- a/src/ride/coaster/twister_roller_coaster.c +++ b/src/ride/coaster/twister_roller_coaster.c @@ -13,3 +13,7978 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void twister_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17486, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17487, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17488, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17489, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17146, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17147, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void twister_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17498, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17499, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17500, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17501, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17204, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17205, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17206, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17207, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void twister_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17514, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17515, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17516, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17517, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17220, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17221, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17222, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17223, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void twister_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17490, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17491, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17492, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17493, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17196, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17197, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17198, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17199, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void twister_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17502, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17503, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17506, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17504, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17507, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17505, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17208, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17209, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17212, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17210, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17213, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17211, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void twister_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17508, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17509, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17512, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17510, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17513, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17511, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17214, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17215, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17218, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17216, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17219, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17217, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void twister_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17494, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17495, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17496, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17497, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17200, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17201, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17202, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17203, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void twister_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17259, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17264, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17269, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17254, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17258, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17263, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17268, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17253, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17257, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17262, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17267, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17252, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17256, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17261, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17266, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17251, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17255, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17260, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17265, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17250, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + twister_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void twister_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17156, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17164, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17157, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17165, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17158, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17159, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void twister_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17160, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17161, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17162, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17166, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17163, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17167, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void twister_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17162, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17166, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17163, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17167, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17160, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17161, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void twister_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17158, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17159, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17156, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17164, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17157, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17165, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void twister_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17279, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17290, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17284, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17289, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17274, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17278, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17283, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17288, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17273, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17277, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17282, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17287, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17272, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17276, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17281, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17286, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17271, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17275, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17280, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17285, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17291, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17270, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + twister_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void twister_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17168, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17172, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17169, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17173, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17170, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17171, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void twister_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17174, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17175, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17176, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17178, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17177, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17179, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void twister_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17180, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17184, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17181, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17185, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17182, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17183, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void twister_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17186, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17187, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17188, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17190, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17189, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17191, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void twister_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17192, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17193, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17194, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17195, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void twister_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17344, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17349, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17354, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17359, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17345, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17350, 0, 0, 32, 16, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17355, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17360, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17346, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17351, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17356, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17361, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17347, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17352, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17357, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17362, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17348, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17353, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17358, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17363, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void twister_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17324, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17329, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17334, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17339, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17325, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17330, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17335, 0, 0, 32, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17340, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17326, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17331, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17336, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17341, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17327, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17332, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17337, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17342, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17328, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17333, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17338, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17343, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void twister_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + twister_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void twister_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + twister_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void twister_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17308, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17312, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17311, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17315, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17309, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17313, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17310, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17314, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17310, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17314, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17309, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17313, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17311, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17315, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17308, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17312, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17316, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17320, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17319, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17323, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17317, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17321, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17318, 0, 0, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17322, 0, 0, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17318, 0, 0, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17322, 0, 0, 32, 26, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17317, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17321, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17319, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17323, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17316, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17320, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_left_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17594, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17602, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17601, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17609, 0, 6, 32, 20, 7, height); + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17595, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17603, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(0, 4, 11, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17600, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17608, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17596, 16, 0, 3, 16, 119, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17604, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17599, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17607, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17597, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17605, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17598, 0, 16, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17606, 0, 16, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17598, 0, 16, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17606, 0, 16, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17597, 0, 0, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17605, 0, 0, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17599, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17607, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17596, 16, 0, 3, 16, 119, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17604, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17600, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17608, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17595, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17603, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(0, 4, 11, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17601, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17609, 0, 6, 32, 20, 7, height); + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17594, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17602, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_7); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_7); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void twister_rc_track_right_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17625, 0, 6, 32, 20, 7, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17617, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17618, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17610, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17624, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17616, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17619, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17611, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17623, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17615, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17620, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17612, 16, 0, 2, 16, 119, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17622, 0, 16, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17614, 0, 16, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17621, 0, 0, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17613, 0, 0, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17621, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17613, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17622, 0, 16, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17614, 0, 16, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17620, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17612, 16, 0, 2, 16, 119, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17623, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17615, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17619, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17611, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17624, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17616, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17618, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17610, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17625, 0, 6, 32, 20, 7, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17617, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_7); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_7); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void twister_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17229, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17232, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17235, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17226, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17228, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17231, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17234, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17225, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17227, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17230, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17233, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17224, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + twister_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void twister_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17241, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17248, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17244, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17247, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17238, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17240, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17243, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17246, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17237, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17239, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17242, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17245, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17249, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17236, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + twister_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void twister_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17375, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17377, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17379, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17373, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17374, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17376, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17378, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17372, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void twister_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17364, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17366, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17368, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17370, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17365, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17367, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17369, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17371, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void twister_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + twister_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void twister_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + twister_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void twister_rc_track_half_loop_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17626, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17634, 0, 6, 32, 20, 11, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17633, 0, 6, 32, 20, 9, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17641, 0, 6, 32, 20, 7, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17627, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17635, 0, 14, 3, 20, 63, height, 28, 6, height); + metal_a_supports_paint_setup(0, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17632, 0, 6, 3, 20, 63, height, 28, 6, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17640, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17628, 16, 0, 2, 16, 119, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17636, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17631, 10, 16, 4, 12, 119, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17639, 16, 16, 2, 16, 119, height, 15, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17629, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17637, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17630, 0, 16, 32, 12, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17638, 0, 16, 32, 12, 3, height + 32); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void twister_rc_track_half_loop_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_half_loop_up(rideIndex, 3 - trackSequence, direction, height, mapElement); +} + +static void twister_rc_track_left_corkscrew_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17690, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17693, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17696, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17699, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17691, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17694, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17697, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17700, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17692, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17695, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17698, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17701, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 35, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void twister_rc_track_right_corkscrew_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17702, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17705, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17708, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17711, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17703, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17706, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17709, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17712, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17704, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17707, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17710, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17713, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 35, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void twister_rc_track_left_corkscrew_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_right_corkscrew_up(rideIndex, 2 - trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void twister_rc_track_right_corkscrew_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_left_corkscrew_up(rideIndex, 2 - trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void twister_rc_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17399, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17406, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17402, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17405, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17396, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17398, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17401, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17404, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17395, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17397, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17400, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17403, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17407, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17394, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17396, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17399, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17406, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17402, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17405, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17395, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17398, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17401, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17404, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17394, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17397, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17400, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17403, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17407, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17380, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17383, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17386, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17389, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17393, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17381, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17384, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17387, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17390, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17382, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17385, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17392, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17388, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17391, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17383, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17386, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17389, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17393, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17380, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17384, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17387, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17390, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17381, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17385, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17392, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17388, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17391, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17382, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + twister_rc_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void twister_rc_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + twister_rc_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void twister_rc_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17439, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17450, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17444, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17449, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17434, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17438, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17443, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17448, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17433, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17437, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17442, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17447, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17432, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17436, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17441, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17446, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17431, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17435, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17440, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17445, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17451, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17430, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17434, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17439, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17450, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17444, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17449, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17433, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17438, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17443, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17448, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17432, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17437, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17442, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17447, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17431, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17436, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17441, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17446, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17430, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17435, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17440, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17445, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17451, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17408, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17413, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17418, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17423, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17429, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17409, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17414, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17419, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17424, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17410, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17415, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17420, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17425, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17411, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17416, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17421, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17426, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17412, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17417, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17428, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17422, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17427, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17413, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17418, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17423, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17429, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17408, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17414, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17419, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17424, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17409, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17415, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17420, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17425, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17410, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17416, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17421, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17426, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17411, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17417, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17428, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17422, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17427, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17412, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + twister_rc_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void twister_rc_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + twister_rc_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void twister_rc_track_left_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17301, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17305, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17302, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17306, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17303, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17307, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17300, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17304, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_left(height - 8, TUNNEL_8); + break; + case 2: + paint_util_push_tunnel_right(height + 56, TUNNEL_7); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_7); + paint_util_push_tunnel_left(height + 56, TUNNEL_7); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void twister_rc_track_right_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17292, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17296, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17293, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17297, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17294, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17298, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17295, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17299, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 56, TUNNEL_7); + paint_util_push_tunnel_left(height - 8, TUNNEL_7); + break; + case 1: + paint_util_push_tunnel_left(height + 56, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_7); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void twister_rc_track_left_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_right_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void twister_rc_track_right_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_left_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void twister_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17148, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17149, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void twister_rc_track_25_deg_up_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17914, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17915, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17916, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17917, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void twister_rc_track_25_deg_up_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17918, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17919, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17920, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17921, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void twister_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, 0x20000000 | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17146, 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(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17147, 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(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17146, 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(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17147, 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); + 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); +} + +static void twister_rc_track_25_deg_down_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_25_deg_up_right_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_25_deg_down_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_25_deg_up_left_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_flat_to_60_deg_up_long_base(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18030, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18034, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18038, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18042, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18031, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18035, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18039, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18043, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18032, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18036, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18040, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18044, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18033, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18037, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18041, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18045, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 18, height, gTrackColours[SCHEME_SUPPORTS]); + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height + 24, TUNNEL_8); + break; + case 2: + paint_util_push_tunnel_left(height + 24, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + } +} + +static void twister_rc_track_60_deg_up_to_flat_long_base(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18046, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18050, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18054, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18058, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18047, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18051, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18055, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18059, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18048, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18052, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18056, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18060, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18049, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18053, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18057, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18061, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 5, height, gTrackColours[SCHEME_SUPPORTS]); + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); + break; + } +} + +static void twister_rc_track_flat_to_60_deg_down_long_base(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_flat_to_60_deg_up_long_base(rideIndex, 3 - trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_60_deg_up_to_flat_long_base122(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_60_deg_up_to_flat_long_base(rideIndex, 3 - trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17526, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17527, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17528, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17529, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + } + paint_util_set_vertical_tunnel(height + 32); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + break; + } +} + +static void twister_rc_track_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_90_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_60_deg_up_to_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17518, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17519, 0, 0, 2, 20, 55, height, 24, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17520, 0, 0, 2, 20, 55, height, 24, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17521, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_vertical_tunnel(height + 48); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + break; + } +} + +static void twister_rc_track_90_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_60_deg_up_to_90_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_90_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17522, 0, 0, 6, 20, 3, height, 0, 6, height + 2); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17523, 0, 0, 2, 20, 31, height, 39, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17524, 0, 0, 2, 20, 31, height, 39, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17525, 0, 0, 6, 20, 3, height, 0, 6, height + 2); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height + 48, TUNNEL_8); + break; + case 2: + paint_util_push_tunnel_left(height + 48, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); +} + +static void twister_rc_track_60_deg_down_to_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17524, 0, 0, 2, 20, 31, height, 39, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17525, 0, 0, 6, 20, 3, height, 0, 6, height + 2); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17522, 0, 0, 6, 20, 3, height, 0, 6, height + 2); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17523, 0, 0, 2, 20, 31, height, 39, 6, height + 8); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 48, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 1: + break; + } +} + +static void twister_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17546, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17550, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17554, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17558, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17547, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17551, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17555, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17559, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17548, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17552, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17556, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17560, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17549, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17553, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17557, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17561, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17530, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17534, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17538, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17542, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17531, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17535, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17539, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17543, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17532, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17536, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17540, 0, 0, 28, 28, 3, height, 4, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17544, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17533, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17537, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17541, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17545, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + twister_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + twister_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void twister_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17578, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17582, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17586, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17590, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17579, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17583, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17587, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17591, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17580, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17584, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17588, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17592, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17581, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17585, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17589, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17593, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17562, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17566, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17570, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17574, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17563, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17567, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17571, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17575, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17564, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17568, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17572, 0, 0, 28, 28, 0, height, 4, 4, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17576, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17565, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17569, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17573, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17577, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + twister_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + twister_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void twister_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17861, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17791, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17858, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17788, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17860, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17790, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17859, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17789, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17873, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17803, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17870, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17800, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17872, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17802, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17871, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17801, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void twister_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17885, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17815, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17882, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17812, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17884, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17814, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17883, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17813, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void twister_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17865, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17795, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17862, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17792, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17864, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17794, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17863, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17793, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void twister_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17877, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17807, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17874, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17804, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17876, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17806, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17875, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17805, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void twister_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17881, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17811, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17878, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17808, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17880, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17810, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17879, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(0, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17809, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(0, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void twister_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17869, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17799, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17866, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17796, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17868, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17798, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17867, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17797, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void twister_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17871, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17801, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17872, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17802, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17870, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17800, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17873, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17803, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void twister_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17883, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17813, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17884, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17814, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17882, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17812, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17885, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17815, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void twister_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17867, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17797, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17868, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17798, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17866, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17796, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17869, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17799, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void twister_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17879, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17809, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17880, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17810, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17878, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17808, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17881, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17811, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void twister_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17875, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17805, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17876, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17806, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17874, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17804, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17877, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17807, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void twister_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17863, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17793, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17864, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17794, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17862, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17792, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17865, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17795, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void twister_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17831, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17828, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17832, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17830, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17829, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17836, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17833, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17835, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17837, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17834, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17834, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17835, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17837, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17833, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17836, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17829, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17830, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17828, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17832, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17831, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17851, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17848, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17852, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17850, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17849, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void twister_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17856, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17853, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17855, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17857, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17854, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void twister_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17841, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17838, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17842, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17840, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17839, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void twister_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17846, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17843, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17845, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17847, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17844, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void twister_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17844, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17845, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17847, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17843, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17846, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void twister_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17839, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17840, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17838, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17842, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17841, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void twister_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17854, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17855, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17857, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17853, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17856, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void twister_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17849, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17850, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17848, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17852, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17851, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void twister_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17827, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17824, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17826, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17825, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17825, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17826, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17824, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17827, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void twister_rc_track_left_barrel_roll_up_to_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17642, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17666, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + metal_a_supports_paint_setup(0, 2, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17645, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17669, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + metal_a_supports_paint_setup(0, 3, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17648, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17672, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + metal_a_supports_paint_setup(0, 1, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17651, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17675, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + metal_a_supports_paint_setup(0, 0, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17643, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17667, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17646, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17670, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17649, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17673, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17652, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17676, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17644, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17668, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17647, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17671, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17650, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17674, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17653, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17677, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_9); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_9); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void twister_rc_track_right_barrel_roll_up_to_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17654, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17678, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + metal_a_supports_paint_setup(0, 0, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17657, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17681, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + metal_a_supports_paint_setup(0, 2, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17660, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17684, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + metal_a_supports_paint_setup(0, 3, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17663, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17687, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + metal_a_supports_paint_setup(0, 1, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17655, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17679, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17658, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17682, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17661, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17685, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17664, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17688, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17656, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17680, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17659, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17683, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17662, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17686, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17665, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17689, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_9); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_9); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void twister_rc_track_left_barrel_roll_down_to_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_left_barrel_roll_up_to_down(rideIndex, 2 - trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_right_barrel_roll_down_to_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_right_barrel_roll_up_to_down(rideIndex, 2 - trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17725, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17727, 0, 6, 32, 20, 3, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17731, 0, 6, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17729, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17723, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17724, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17726, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17728, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17722, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void twister_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17714, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17716, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17718, 0, 6, 32, 20, 3, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17730, 0, 6, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17720, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17715, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17717, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17719, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17721, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void twister_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17717, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17719, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17721, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17715, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17716, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17718, 6, 0, 20, 32, 3, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17730, 6, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17720, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17714, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void twister_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17722, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17724, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17726, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17728, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17723, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17725, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17727, 6, 0, 20, 32, 3, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17731, 6, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17729, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void twister_rc_track_powered_lift(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17476, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17477, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17478, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17479, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void twister_rc_track_left_large_half_loop_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17732, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17739, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17746, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17753, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17733, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17740, 0, 0, 32, 20, 9, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17747, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17754, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17734, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17741, 0, 0, 32, 16, 0, height, 0, 0, height + 70); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17748, 0, 0, 32, 16, 0, height, 0, 16, height + 70); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17755, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17735, 0, 0, 32, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 5, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17742, 0, 0, 32, 16, 0, height, 0, 0, height + 200); + metal_a_supports_paint_setup(0, 6, 22, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17749, 0, 0, 32, 16, 0, height, 0, 16, height + 200); + metal_a_supports_paint_setup(0, 8, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17756, 0, 0, 32, 16, 3, height, 0, 16, height); + metal_a_supports_paint_setup(0, 7, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 224, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17736, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17743, 0, 0, 16, 16, 0, height, 0, 16, height + 110); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17750, 0, 0, 16, 16, 0, height, 0, 0, height + 100); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17757, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 128, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17737, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17744, 0, 0, 32, 16, 0, height, 0, 16, height + 200); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17751, 0, 0, 32, 16, 0, height, 0, 0, height + 200); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17758, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 224, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17738, 0, 0, 32, 16, 0, height, 0, 16, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17745, 0, 0, 32, 16, 0, height, 0, 16, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17752, 0, 0, 32, 16, 0, height, 0, 0, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17759, 0, 0, 32, 16, 0, height, 0, 0, height + 32); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); + break; + } +} + +static void twister_rc_track_right_large_half_loop_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17781, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17774, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17767, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17760, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17782, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17775, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17768, 0, 0, 32, 20, 9, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17761, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17783, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17776, 0, 0, 32, 16, 0, height, 0, 16, height + 70); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17769, 0, 0, 32, 16, 0, height, 0, 0, height + 70); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17762, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17784, 0, 0, 32, 16, 3, height, 0, 16, height); + metal_a_supports_paint_setup(0, 8, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17777, 0, 0, 32, 16, 0, height, 0, 16, height + 200); + metal_a_supports_paint_setup(0, 7, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17770, 0, 0, 32, 16, 0, height, 0, 0, height + 200); + metal_a_supports_paint_setup(0, 5, 22, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17763, 0, 0, 32, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 6, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 224, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17785, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17778, 0, 0, 16, 16, 0, height, 0, 0, height + 100); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17771, 0, 0, 16, 16, 0, height, 0, 16, height + 110); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17764, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 128, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17786, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17779, 0, 0, 32, 16, 0, height, 0, 0, height + 200); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17772, 0, 0, 32, 16, 0, height, 0, 16, height + 200); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17765, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 224, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17787, 0, 0, 32, 16, 0, height, 0, 0, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17780, 0, 0, 32, 16, 0, height, 0, 0, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17773, 0, 0, 32, 16, 0, height, 0, 16, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17766, 0, 0, 32, 16, 0, height, 0, 16, height + 32); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); + break; + } +} + +static void twister_rc_track_right_large_half_loop_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_right_large_half_loop_up(rideIndex, 6 - trackSequence, direction, height, mapElement); +} + +static void twister_rc_track_left_large_half_loop_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_left_large_half_loop_up(rideIndex, 6 - trackSequence, direction, height, mapElement); +} + +static void twister_rc_track_90_deg_to_inverted_flat_quarter_loop_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18062, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18065, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18068, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18071, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18063, 0, 0, 2, 20, 31, height, -8, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18066, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18069, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18072, 0, 0, 2, 20, 31, height, -8, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18064, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18067, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18070, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18073, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 16, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void twister_rc_track_inverted_flat_to_90_deg_quarter_loop_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_90_deg_to_inverted_flat_quarter_loop_up(rideIndex, 2 - trackSequence, direction, height, mapElement); +} + +static void twister_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17150, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17151, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void twister_rc_track_left_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18025, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18027, 0, 6, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18029, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18023, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18024, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18026, 6, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18028, 6, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18022, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void twister_rc_track_right_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18014, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18016, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18018, 0, 6, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18020, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18015, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18017, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18019, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18021, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void twister_rc_track_left_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + twister_rc_track_right_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void twister_rc_track_right_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + twister_rc_track_left_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void twister_rc_track_left_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17978, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17983, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17988, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17993, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17979, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17984, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17989, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17994, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17980, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17985, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17990, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17995, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17981, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17986, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17991, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17996, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17982, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17987, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17992, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17997, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void twister_rc_track_right_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17958, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17963, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17968, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17973, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17959, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17964, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17969, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17974, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17960, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17965, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17970, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17975, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17961, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17966, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17971, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17976, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17962, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17967, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17972, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17977, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void twister_rc_track_left_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + twister_rc_track_right_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void twister_rc_track_right_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + twister_rc_track_left_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void twister_rc_track_25_deg_up_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17922, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17923, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17930, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17924, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17925, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void twister_rc_track_25_deg_up_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17926, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17927, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17928, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17931, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17929, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void twister_rc_track_left_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17932, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17933, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17940, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17934, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17935, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void twister_rc_track_right_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17936, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17937, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17938, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17941, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17939, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void twister_rc_track_25_deg_down_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_right_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_25_deg_down_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_left_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_left_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_25_deg_up_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_right_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_25_deg_up_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_left_banked_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17942, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17943, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17944, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17945, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void twister_rc_track_right_banked_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17946, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17947, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17948, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17949, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void twister_rc_track_left_banked_25_deg_up_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17950, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17951, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17952, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17953, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void twister_rc_track_right_banked_25_deg_up_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17954, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17955, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17956, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17957, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void twister_rc_track_left_banked_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_right_banked_25_deg_up_to_right_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_right_banked_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_left_banked_25_deg_up_to_left_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_left_banked_25_deg_down_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_right_banked_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_right_banked_25_deg_down_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_left_banked_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17894, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17895, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17902, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17896, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17897, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void twister_rc_track_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17898, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17899, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17900, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17903, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17901, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void twister_rc_track_left_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17904, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17905, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17912, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17906, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17907, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void twister_rc_track_right_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17908, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17909, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17910, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17913, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17911, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void twister_rc_track_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_right_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_left_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_left_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_right_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void twister_rc_track_left_quarter_turn_1_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17998, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17999, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18007, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18008, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18001, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18009, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + } + paint_util_set_vertical_tunnel(height + 96); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 96, 0x20); + break; + case 1: + break; + } +} + +static void twister_rc_track_right_quarter_turn_1_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18002, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18010, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18011, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18004, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18012, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18005, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + break; + } + paint_util_set_vertical_tunnel(height + 96); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 96, 0x20); + break; + case 1: + break; + } +} + +static void twister_rc_track_left_quarter_turn_1_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_right_quarter_turn_1_90_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void twister_rc_track_right_quarter_turn_1_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + twister_rc_track_left_quarter_turn_1_90_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_twister_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return twister_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return twister_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return twister_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return twister_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return twister_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return twister_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return twister_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return twister_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return twister_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return twister_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return twister_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return twister_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return twister_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return twister_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return twister_rc_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return twister_rc_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return twister_rc_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return twister_rc_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return twister_rc_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return twister_rc_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return twister_rc_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return twister_rc_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return twister_rc_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return twister_rc_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return twister_rc_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return twister_rc_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return twister_rc_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return twister_rc_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return twister_rc_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return twister_rc_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return twister_rc_track_right_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: + return twister_rc_track_left_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: + return twister_rc_track_right_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return twister_rc_track_left_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return twister_rc_track_right_quarter_turn_5_25_deg_down; + case TRACK_ELEM_S_BEND_LEFT: + return twister_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return twister_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_VERTICAL_LOOP: + return twister_rc_track_left_vertical_loop; + case TRACK_ELEM_RIGHT_VERTICAL_LOOP: + return twister_rc_track_right_vertical_loop; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return twister_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return twister_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return twister_rc_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return twister_rc_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return twister_rc_track_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return twister_rc_track_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return twister_rc_track_left_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return twister_rc_track_right_quarter_turn_3_25_deg_down; + case TRACK_ELEM_HALF_LOOP_UP: + return twister_rc_track_half_loop_up; + case TRACK_ELEM_HALF_LOOP_DOWN: + return twister_rc_track_half_loop_down; + case TRACK_ELEM_LEFT_CORKSCREW_UP: + return twister_rc_track_left_corkscrew_up; + case TRACK_ELEM_RIGHT_CORKSCREW_UP: + return twister_rc_track_right_corkscrew_up; + case TRACK_ELEM_LEFT_CORKSCREW_DOWN: + return twister_rc_track_left_corkscrew_down; + case TRACK_ELEM_RIGHT_CORKSCREW_DOWN: + return twister_rc_track_right_corkscrew_down; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: + return twister_rc_track_left_half_banked_helix_up_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: + return twister_rc_track_right_half_banked_helix_up_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: + return twister_rc_track_left_half_banked_helix_down_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: + return twister_rc_track_right_half_banked_helix_down_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: + return twister_rc_track_left_half_banked_helix_up_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: + return twister_rc_track_right_half_banked_helix_up_large; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: + return twister_rc_track_left_half_banked_helix_down_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: + return twister_rc_track_right_half_banked_helix_down_large; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP: + return twister_rc_track_left_quarter_turn_1_60_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP: + return twister_rc_track_right_quarter_turn_1_60_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return twister_rc_track_left_quarter_turn_1_60_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return twister_rc_track_right_quarter_turn_1_60_deg_down; + case TRACK_ELEM_BRAKES: + return twister_rc_track_brakes; + case TRACK_ELEM_25_DEG_UP_LEFT_BANKED: + return twister_rc_track_25_deg_up_left_banked; + case TRACK_ELEM_25_DEG_UP_RIGHT_BANKED: + return twister_rc_track_25_deg_up_right_banked; + case TRACK_ELEM_ON_RIDE_PHOTO: + return twister_rc_track_on_ride_photo; + case TRACK_ELEM_25_DEG_DOWN_LEFT_BANKED: + return twister_rc_track_25_deg_down_left_banked; + case TRACK_ELEM_25_DEG_DOWN_RIGHT_BANKED: + return twister_rc_track_25_deg_down_right_banked; + case TRACK_ELEM_FLAT_TO_60_DEG_UP_LONG_BASE: + return twister_rc_track_flat_to_60_deg_up_long_base; + case TRACK_ELEM_60_DEG_UP_TO_FLAT_LONG_BASE: + return twister_rc_track_60_deg_up_to_flat_long_base; + case TRACK_ELEM_FLAT_TO_60_DEG_DOWN_LONG_BASE: + return twister_rc_track_flat_to_60_deg_down_long_base; + case TRACK_ELEM_60_DEG_UP_TO_FLAT_LONG_BASE_122: + return twister_rc_track_60_deg_up_to_flat_long_base122; + case TRACK_ELEM_90_DEG_UP: + return twister_rc_track_90_deg_up; + case TRACK_ELEM_90_DEG_DOWN: + return twister_rc_track_90_deg_down; + case TRACK_ELEM_60_DEG_UP_TO_90_DEG_UP: + return twister_rc_track_60_deg_up_to_90_deg_up; + case TRACK_ELEM_90_DEG_DOWN_TO_60_DEG_DOWN: + return twister_rc_track_90_deg_down_to_60_deg_down; + case TRACK_ELEM_90_DEG_UP_TO_60_DEG_UP: + return twister_rc_track_90_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_DOWN_TO_90_DEG_DOWN: + return twister_rc_track_60_deg_down_to_90_deg_down; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return twister_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return twister_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return twister_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return twister_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + return twister_rc_track_left_eighth_bank_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + return twister_rc_track_right_eighth_bank_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + return twister_rc_track_left_eighth_bank_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + return twister_rc_track_right_eighth_bank_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return twister_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return twister_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP: + return twister_rc_track_diag_60_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return twister_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + return twister_rc_track_diag_25_deg_up_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + return twister_rc_track_diag_60_deg_up_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return twister_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return twister_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN: + return twister_rc_track_diag_60_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return twister_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + return twister_rc_track_diag_25_deg_down_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + return twister_rc_track_diag_60_deg_down_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return twister_rc_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + return twister_rc_track_diag_flat_to_left_bank; + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + return twister_rc_track_diag_flat_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + return twister_rc_track_diag_left_bank_to_flat; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + return twister_rc_track_diag_right_bank_to_flat; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + return twister_rc_track_diag_left_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + return twister_rc_track_diag_right_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + return twister_rc_track_diag_25_deg_up_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + return twister_rc_track_diag_25_deg_up_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + return twister_rc_track_diag_left_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + return twister_rc_track_diag_right_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + return twister_rc_track_diag_25_deg_down_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + return twister_rc_track_diag_25_deg_down_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK: + return twister_rc_track_diag_left_bank; + case TRACK_ELEM_DIAG_RIGHT_BANK: + return twister_rc_track_diag_right_bank; + case TRACK_ELEM_LEFT_BARREL_ROLL_UP_TO_DOWN: + return twister_rc_track_left_barrel_roll_up_to_down; + case TRACK_ELEM_RIGHT_BARREL_ROLL_UP_TO_DOWN: + return twister_rc_track_right_barrel_roll_up_to_down; + case TRACK_ELEM_LEFT_BARREL_ROLL_DOWN_TO_UP: + return twister_rc_track_left_barrel_roll_down_to_up; + case TRACK_ELEM_RIGHT_BARREL_ROLL_DOWN_TO_UP: + return twister_rc_track_right_barrel_roll_down_to_up; + case TRACK_ELEM_LEFT_BANK_TO_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return twister_rc_track_left_bank_to_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return twister_rc_track_right_bank_to_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN_TO_LEFT_BANK: + return twister_rc_track_left_quarter_turn_3_25_deg_down_to_left_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN_TO_RIGHT_BANK: + return twister_rc_track_right_quarter_turn_3_25_deg_down_to_right_bank; + case TRACK_ELEM_POWERED_LIFT: + return twister_rc_track_powered_lift; + case TRACK_ELEM_LEFT_LARGE_HALF_LOOP_UP: + return twister_rc_track_left_large_half_loop_up; + case TRACK_ELEM_RIGHT_LARGE_HALF_LOOP_UP: + return twister_rc_track_right_large_half_loop_up; + case TRACK_ELEM_RIGHT_LARGE_HALF_LOOP_DOWN: + return twister_rc_track_right_large_half_loop_down; + case TRACK_ELEM_LEFT_LARGE_HALF_LOOP_DOWN: + return twister_rc_track_left_large_half_loop_down; + case TRACK_ELEM_90_DEG_TO_INVERTED_FLAT_QUARTER_LOOP_UP: + return twister_rc_track_90_deg_to_inverted_flat_quarter_loop_up; + case TRACK_ELEM_INVERTED_FLAT_TO_90_DEG_QUARTER_LOOP_DOWN: + return twister_rc_track_inverted_flat_to_90_deg_quarter_loop_down; + case TRACK_ELEM_BLOCK_BRAKES: + return twister_rc_track_block_brakes; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return twister_rc_track_left_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return twister_rc_track_right_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return twister_rc_track_left_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return twister_rc_track_right_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return twister_rc_track_left_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return twister_rc_track_right_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return twister_rc_track_left_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return twister_rc_track_right_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANKED_25_DEG_UP: + return twister_rc_track_25_deg_up_to_left_banked_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANKED_25_DEG_UP: + return twister_rc_track_25_deg_up_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return twister_rc_track_left_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return twister_rc_track_right_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANKED_25_DEG_DOWN: + return twister_rc_track_25_deg_down_to_left_banked_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANKED_25_DEG_DOWN: + return twister_rc_track_25_deg_down_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return twister_rc_track_left_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return twister_rc_track_right_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return twister_rc_track_left_banked_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return twister_rc_track_right_banked_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_LEFT_BANKED_FLAT: + return twister_rc_track_left_banked_25_deg_up_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_RIGHT_BANKED_FLAT: + return twister_rc_track_right_banked_25_deg_up_to_right_banked_flat; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return twister_rc_track_left_banked_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return twister_rc_track_right_banked_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_LEFT_BANKED_FLAT: + return twister_rc_track_left_banked_25_deg_down_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_RIGHT_BANKED_FLAT: + return twister_rc_track_right_banked_25_deg_down_to_right_banked_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return twister_rc_track_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return twister_rc_track_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_FLAT: + return twister_rc_track_left_banked_25_deg_up_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_FLAT: + return twister_rc_track_right_banked_25_deg_up_to_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return twister_rc_track_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return twister_rc_track_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_FLAT: + return twister_rc_track_left_banked_25_deg_down_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_FLAT: + return twister_rc_track_right_banked_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_90_DEG_UP: + return twister_rc_track_left_quarter_turn_1_90_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_90_DEG_UP: + return twister_rc_track_right_quarter_turn_1_90_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_90_DEG_DOWN: + return twister_rc_track_left_quarter_turn_1_90_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_90_DEG_DOWN: + return twister_rc_track_right_quarter_turn_1_90_deg_down; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index e3b1aa6472..7992b258ea 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6292,7 +6292,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_facility, // RIDE_TYPE_FIRST_AID get_track_paint_function_circus_show, // RIDE_TYPE_CIRCUS_SHOW get_track_paint_function_ghost_train, // RIDE_TYPE_GHOST_TRAIN - 0, // RIDE_TYPE_TWISTER_ROLLER_COASTER + get_track_paint_function_twister_rc, // RIDE_TYPE_TWISTER_ROLLER_COASTER 0, // RIDE_TYPE_WOODEN_ROLLER_COASTER 0, // RIDE_TYPE_SIDE_FRICTION_ROLLER_COASTER get_track_paint_function_wild_mouse, // RIDE_TYPE_WILD_MOUSE diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 86b294ad22..be8b2ec857 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -302,6 +302,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_twist(int trackType, int direction TRACK_PAINT_FUNCTION get_track_paint_function_haunted_house(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_circus_show(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_ghost_train(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_twister_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_wild_mouse(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_virginia_reel(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_splash_boats(int trackType, int direction); From 8e4f9003b30131f350210644f33d395462ece52a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:39:30 +0200 Subject: [PATCH 14/55] Add generated Side friction RC --- .../coaster/side_friction_roller_coaster.c | 1920 +++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 1922 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/side_friction_roller_coaster.c b/src/ride/coaster/side_friction_roller_coaster.c index 846fd9695d..99267cffe4 100644 --- a/src/ride/coaster/side_friction_roller_coaster.c +++ b/src/ride/coaster/side_friction_roller_coaster.c @@ -13,3 +13,1923 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void side_friction_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21662, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21664, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21663, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21665, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21666, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21668, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21667, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21669, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21606, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21608, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21607, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21609, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + 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 side_friction_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21678, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21690, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(0, 9, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21679, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21691, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(1, 10, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21680, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21692, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(0, 11, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21681, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21693, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(1, 12, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21622, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21634, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(0, 9, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21623, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21635, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(1, 10, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21624, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21636, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(0, 11, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21625, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21637, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(1, 12, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void side_friction_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21670, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21682, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(0, 1, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21671, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21683, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(1, 2, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21672, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21684, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(0, 3, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21673, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21685, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(1, 4, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21614, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21626, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(0, 1, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21615, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21627, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(1, 2, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21616, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21628, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(0, 3, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21617, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21629, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(1, 4, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void side_friction_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21674, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21686, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(0, 5, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21675, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21687, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(1, 6, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21676, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21688, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(0, 7, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21677, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21689, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(1, 8, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21618, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21630, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(0, 5, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21619, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21631, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(1, 6, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21620, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21632, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(0, 7, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21621, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21633, 0, 0, 32, 1, 9, height, 0, 26, height + 5); + wooden_a_supports_paint_setup(1, 8, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void side_friction_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + side_friction_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void side_friction_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + side_friction_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void side_friction_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + side_friction_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void side_friction_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21727, 0, 2, 32, 27, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21747, 0, 2, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21732, 0, 2, 32, 27, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21752, 0, 2, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21737, 0, 2, 32, 32, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21757, 0, 2, 32, 32, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21722, 0, 2, 32, 32, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21742, 0, 2, 32, 32, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21726, 0, 0, 32, 16, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21746, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21731, 0, 0, 32, 16, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21751, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21736, 0, 16, 32, 16, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21756, 0, 16, 32, 16, 0, height, 0, 16, height + 27); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21721, 0, 16, 32, 16, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21741, 0, 16, 32, 16, 0, height, 0, 16, height + 27); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21725, 0, 16, 16, 16, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21745, 0, 16, 16, 16, 0, height, 0, 16, height + 27); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21730, 16, 16, 16, 16, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21750, 16, 16, 16, 16, 0, height, 16, 16, height + 27); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21735, 16, 0, 16, 16, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21755, 16, 0, 16, 16, 0, height, 16, 0, height + 27); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21720, 0, 0, 16, 16, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21740, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21724, 16, 0, 16, 34, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21744, 16, 0, 16, 34, 0, height, 16, 0, height + 27); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21729, 0, 0, 16, 32, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21749, 0, 0, 16, 32, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21734, 0, 0, 16, 32, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21754, 0, 0, 16, 32, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21719, 16, 0, 16, 32, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21739, 16, 0, 16, 32, 0, height, 16, 0, height + 27); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21723, 2, 0, 32, 32, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21743, 2, 0, 32, 32, 0, height, 2, 0, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21728, 2, 0, 27, 32, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21748, 2, 0, 27, 32, 0, height, 2, 0, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21733, 2, 0, 27, 32, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21753, 2, 0, 27, 32, 0, height, 2, 0, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21718, 2, 0, 32, 32, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21738, 2, 0, 32, 32, 0, height, 2, 0, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void side_friction_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + side_friction_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void side_friction_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21888, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21904, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21892, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21908, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21891, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21907, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21895, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21911, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21889, 0, 0, 32, 26, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21905, 0, 0, 32, 26, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21893, 0, 0, 32, 26, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21909, 0, 0, 32, 26, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21890, 0, 0, 32, 26, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21906, 0, 0, 32, 26, 0, height, 0, 6, height + 27); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21894, 0, 0, 32, 26, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21910, 0, 0, 32, 26, 0, height, 0, 6, height + 27); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21890, 0, 0, 32, 26, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21906, 0, 0, 32, 26, 0, height, 0, 6, height + 27); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21894, 0, 0, 32, 26, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21910, 0, 0, 32, 26, 0, height, 0, 6, height + 27); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21889, 0, 0, 32, 26, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21905, 0, 0, 32, 26, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21893, 0, 0, 32, 26, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21909, 0, 0, 32, 26, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21891, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21907, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21895, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21911, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21888, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21904, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21892, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21908, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void side_friction_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21896, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21912, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21900, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21916, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21899, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21915, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21903, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21919, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21897, 0, 0, 32, 26, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21913, 0, 0, 32, 26, 0, height, 0, 6, height + 27); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21901, 0, 0, 32, 26, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21917, 0, 0, 32, 26, 0, height, 0, 6, height + 27); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21898, 0, 0, 32, 26, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21914, 0, 0, 32, 26, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21902, 0, 0, 32, 26, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21918, 0, 0, 32, 26, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21898, 0, 0, 32, 26, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21914, 0, 0, 32, 26, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21902, 0, 0, 32, 26, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21918, 0, 0, 32, 26, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21897, 0, 0, 32, 26, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21913, 0, 0, 32, 26, 0, height, 0, 6, height + 27); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21901, 0, 0, 32, 26, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21917, 0, 0, 32, 26, 0, height, 0, 6, height + 27); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21899, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21915, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21903, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21919, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21896, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21912, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21900, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21916, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void side_friction_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21699, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21711, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21702, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21714, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21705, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21717, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21696, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21708, 0, 0, 32, 20, 0, height, 0, 6, height + 27); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21698, 0, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21710, 0, 0, 16, 16, 0, height, 16, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21701, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21713, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21704, 0, 0, 16, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21716, 0, 0, 16, 16, 0, height, 0, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21695, 0, 0, 16, 16, 2, height, 16, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21707, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21697, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21709, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21700, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21712, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21703, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21715, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21694, 0, 0, 20, 32, 2, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21706, 0, 0, 20, 32, 0, height, 6, 0, height + 27); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void side_friction_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + side_friction_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void side_friction_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21610, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21612, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21611, 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21613, 0, 0, 32, 27, 0, height, 0, 2, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + 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 side_friction_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21790, 0, 0, 32, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21806, 0, 0, 32, 32, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21794, 0, 0, 32, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21810, 0, 0, 32, 32, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21798, 0, 0, 32, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21814, 0, 0, 32, 32, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21802, 0, 0, 32, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21818, 0, 0, 32, 32, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21791, 0, 0, 32, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21807, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21795, 0, 0, 34, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21811, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21799, 0, 0, 32, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21815, 0, 0, 32, 16, 0, height, 0, 16, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21803, 0, 0, 32, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21819, 0, 0, 32, 16, 0, height, 0, 16, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21792, 0, 0, 16, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21808, 0, 0, 16, 16, 0, height, 0, 16, height + 27); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21796, 0, 0, 16, 16, 2, height, 16, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21812, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21800, 0, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21816, 0, 0, 16, 16, 0, height, 16, 0, height + 27); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21804, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21820, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21793, 0, 0, 16, 16, 2, height, 16, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21809, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21797, 0, 0, 16, 18, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21813, 0, 0, 16, 16, 0, height, 0, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21801, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21817, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21805, 0, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21821, 0, 0, 16, 16, 0, height, 16, 0, height + 27); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void side_friction_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21758, 0, 0, 32, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21774, 0, 0, 32, 32, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21762, 0, 0, 32, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21778, 0, 0, 32, 32, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21766, 0, 0, 32, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21782, 0, 0, 32, 32, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21770, 0, 0, 32, 32, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21786, 0, 0, 32, 32, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21759, 0, 0, 32, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21775, 0, 0, 32, 16, 0, height, 0, 16, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21763, 0, 0, 32, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21779, 0, 0, 32, 16, 0, height, 0, 16, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21767, 0, 0, 34, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21783, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21771, 0, 0, 32, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21787, 0, 0, 32, 16, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21760, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21776, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21764, 0, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21780, 0, 0, 16, 16, 0, height, 16, 0, height + 27); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21768, 0, 0, 28, 28, 2, height, 4, 4, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21784, 0, 0, 28, 28, 0, height, 4, 4, height + 27); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21772, 0, 0, 16, 16, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21788, 0, 0, 16, 16, 0, height, 0, 16, height + 27); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21761, 0, 0, 16, 16, 2, height, 16, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21777, 0, 0, 16, 16, 0, height, 16, 0, height + 27); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21765, 0, 0, 16, 16, 2, height, 0, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21781, 0, 0, 16, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21769, 0, 0, 16, 18, 2, height, 0, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21785, 0, 0, 16, 16, 0, height, 0, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21773, 0, 0, 16, 16, 2, height, 16, 16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21789, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void side_friction_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + side_friction_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void side_friction_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + side_friction_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void side_friction_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21849, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21825, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21846, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21850, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21822, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21826, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21848, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21851, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21824, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21827, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21847, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21823, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void side_friction_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21867, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21843, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21864, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21868, -16, -16, 32, 32, 0, height, -16, -16, height + 43); + wooden_a_supports_paint_setup(2, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(3, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(4, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(5, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21840, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21844, -16, -16, 32, 32, 0, height, -16, -16, height + 43); + wooden_a_supports_paint_setup(2, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(3, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(4, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(5, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(4, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(5, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21866, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21869, -16, -16, 32, 32, 0, height, -16, -16, height + 43); + wooden_a_supports_paint_setup(2, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(3, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(4, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(5, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21842, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21845, -16, -16, 32, 32, 0, height, -16, -16, height + 43); + wooden_a_supports_paint_setup(2, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(3, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21865, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21841, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void side_friction_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21855, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21831, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21852, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21856, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21828, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21832, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21854, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21857, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21830, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21833, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21853, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21829, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void side_friction_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21861, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21837, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21858, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21862, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(2, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(3, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(4, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(5, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21834, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21838, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(2, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(3, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(4, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(5, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(4, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(5, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21860, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21863, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(2, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(3, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(4, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(5, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21836, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21839, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(2, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(3, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21859, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21835, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void side_friction_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21865, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21841, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21866, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21869, -16, -16, 32, 32, 0, height, -16, -16, height + 43); + wooden_a_supports_paint_setup(2, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(3, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(4, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(5, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21842, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21845, -16, -16, 32, 32, 0, height, -16, -16, height + 43); + wooden_a_supports_paint_setup(2, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(3, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(4, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(5, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(4, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(5, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21864, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21868, -16, -16, 32, 32, 0, height, -16, -16, height + 43); + wooden_a_supports_paint_setup(2, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(3, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(4, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(5, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21840, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21844, -16, -16, 32, 32, 0, height, -16, -16, height + 43); + wooden_a_supports_paint_setup(2, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(3, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21867, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21843, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void side_friction_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21859, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21835, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21860, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21863, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(2, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(3, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(4, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(5, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21836, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21839, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(2, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(3, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(4, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(5, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(4, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(5, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21858, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21862, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(2, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(3, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(4, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(5, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21834, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21838, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(2, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(3, 0, height + 16, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21861, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21837, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void side_friction_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21853, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21829, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21854, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21857, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21830, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21833, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21852, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21856, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21828, -16, -16, 32, 32, 2, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21832, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21855, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21831, -16, -16, 32, 32, 2, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +TRACK_PAINT_FUNCTION get_track_paint_function_side_friction_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return side_friction_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return side_friction_rc_track_25_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return side_friction_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return side_friction_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return side_friction_rc_track_25_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return side_friction_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return side_friction_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return side_friction_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return side_friction_rc_track_right_quarter_turn_5; + case TRACK_ELEM_S_BEND_LEFT: + return side_friction_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return side_friction_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return side_friction_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return side_friction_rc_track_right_quarter_turn_3; + case TRACK_ELEM_BRAKES: + return side_friction_rc_track_brakes; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return side_friction_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return side_friction_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return side_friction_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return side_friction_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return side_friction_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return side_friction_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return side_friction_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return side_friction_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return side_friction_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return side_friction_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return side_friction_rc_track_diag_25_deg_down_to_flat; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 7992b258ea..7d55514da1 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6294,7 +6294,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_ghost_train, // RIDE_TYPE_GHOST_TRAIN get_track_paint_function_twister_rc, // RIDE_TYPE_TWISTER_ROLLER_COASTER 0, // RIDE_TYPE_WOODEN_ROLLER_COASTER - 0, // RIDE_TYPE_SIDE_FRICTION_ROLLER_COASTER + get_track_paint_function_side_friction_rc, // RIDE_TYPE_SIDE_FRICTION_ROLLER_COASTER get_track_paint_function_wild_mouse, // RIDE_TYPE_WILD_MOUSE 0, // RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER 0, // RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER_ALT diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index be8b2ec857..a57003aae2 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -303,6 +303,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_haunted_house(int trackType, int d TRACK_PAINT_FUNCTION get_track_paint_function_circus_show(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_ghost_train(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_twister_rc(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_side_friction_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_wild_mouse(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_virginia_reel(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_splash_boats(int trackType, int direction); From ea485d86ddce8d741cbf65b902b64bb1a3d2edf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:41:10 +0200 Subject: [PATCH 15/55] Add generated Multi dimension RC --- .../coaster/multi_dimension_roller_coaster.c | 9442 +++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 9444 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/multi_dimension_roller_coaster.c b/src/ride/coaster/multi_dimension_roller_coaster.c index 846fd9695d..f226ad9604 100644 --- a/src/ride/coaster/multi_dimension_roller_coaster.c +++ b/src/ride/coaster/multi_dimension_roller_coaster.c @@ -13,3 +13,9445 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void multi_dimension_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15808, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15809, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15806, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15807, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + 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); + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26227, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 22); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26228, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 22); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 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)) { + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15908, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15909, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15910, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15911, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15880, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15881, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15882, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15883, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26253, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26254, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26255, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26256, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + } +} + +static void multi_dimension_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15896, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15897, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15898, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15899, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 24, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26269, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 88); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26270, 0, 0, 32, 2, 81, height + 24, 0, 4, height + 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26271, 0, 0, 32, 2, 81, height + 24, 0, 4, height + 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26272, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 88); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + } +} + +static void multi_dimension_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15900, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15901, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15902, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15903, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15872, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15873, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15874, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15875, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26245, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26246, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26247, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26248, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + } +} + +static void multi_dimension_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15884, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15885, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15888, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15886, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15889, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15887, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26257, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 56); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26261, 0, 0, 32, 10, 49, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26258, 0, 0, 32, 2, 49, height + 24, 0, 4, height + 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26262, 0, 0, 32, 10, 49, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26259, 0, 0, 32, 2, 49, height + 24, 0, 4, height + 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26260, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 56); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + } +} + +static void multi_dimension_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15890, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15891, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15894, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15892, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15895, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15893, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26263, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 56); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 68, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26267, 0, 0, 32, 10, 49, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26264, 0, 0, 32, 2, 49, height + 24, 0, 4, height + 6); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 68, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26268, 0, 0, 32, 10, 49, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26265, 0, 0, 32, 2, 49, height + 24, 0, 4, height + 6); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 68, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26266, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 56); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 68, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + } +} + +static void multi_dimension_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15904, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15905, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15906, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15907, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15876, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15877, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15878, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15879, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26249, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26250, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26251, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26252, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); + } +} + +static void multi_dimension_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + multi_dimension_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + multi_dimension_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + multi_dimension_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + multi_dimension_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + multi_dimension_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + multi_dimension_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15921, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15926, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15931, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15916, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15920, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15925, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15930, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15915, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15919, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15924, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15929, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15914, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15918, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15923, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15928, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15913, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15917, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15922, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15927, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15912, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26310, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26315, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26320, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26305, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26309, 0, 0, 32, 16, 3, height + 24, 0, 0, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26314, 0, 0, 32, 16, 3, height + 24, 0, 0, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26319, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26304, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26308, 0, 0, 16, 16, 3, height + 24, 0, 16, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26313, 0, 0, 16, 16, 3, height + 24, 16, 16, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26318, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26303, 0, 0, 16, 16, 3, height + 24, 0, 0, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26307, 0, 0, 16, 32, 3, height + 24, 16, 0, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26312, 0, 0, 16, 32, 3, height + 24, 0, 0, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26317, 0, 0, 16, 32, 3, height + 24, 0, 0, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26302, 0, 0, 16, 32, 3, height + 24, 16, 0, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26306, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26311, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26316, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26301, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 22); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + multi_dimension_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15832, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15840, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15833, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15841, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15834, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15835, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + 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); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26273, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26274, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26275, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26276, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + } +} + +static void multi_dimension_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15836, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15837, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15838, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15842, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15839, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15843, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + 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); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26277, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26278, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26279, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26280, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + } +} + +static void multi_dimension_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15838, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15842, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15839, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15843, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15836, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15837, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + 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); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26279, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26280, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26277, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26278, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + } +} + +static void multi_dimension_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15834, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15835, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15832, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15840, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15833, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15841, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + 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); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26275, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26276, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26273, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26274, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + } +} + +static void multi_dimension_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15941, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15952, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15946, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15951, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15936, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15940, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15945, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15950, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15935, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15939, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15944, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15949, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15934, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15938, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15943, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15948, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15933, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15937, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15942, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15947, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15953, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15932, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26354, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26359, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26364, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26349, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26353, 0, 0, 32, 16, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26358, 0, 0, 32, 16, 3, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26363, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26348, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26352, 0, 0, 16, 16, 3, height + 24, 0, 16, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26357, 0, 0, 16, 16, 3, height + 24, 16, 16, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26362, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26347, 0, 0, 16, 16, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26351, 0, 0, 16, 32, 3, height + 24, 16, 0, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26356, 0, 0, 16, 32, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26361, 0, 0, 16, 32, 3, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26346, 0, 0, 16, 32, 3, height + 24, 16, 0, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26350, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26355, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26360, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26345, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + multi_dimension_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15844, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15848, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15845, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15849, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15846, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15847, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26281, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26282, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26283, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26284, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + } +} + +static void multi_dimension_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15850, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15851, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15852, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15854, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15853, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15855, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26285, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26286, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26287, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26288, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + } +} + +static void multi_dimension_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15856, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15860, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15857, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15861, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15858, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15859, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26289, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26290, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26291, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26292, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); + } +} + +static void multi_dimension_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15862, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15863, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15864, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15866, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15865, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15867, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26293, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26294, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26295, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26296, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); + } +} + +static void multi_dimension_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + multi_dimension_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + multi_dimension_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + multi_dimension_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + multi_dimension_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15868, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15869, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15870, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15871, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + 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); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26297, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26298, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26299, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26300, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + } +} + +static void multi_dimension_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + multi_dimension_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15816, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15820, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15819, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15823, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15817, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15821, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15818, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15822, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15818, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15822, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15817, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15821, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15819, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15823, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15816, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15820, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26229, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26233, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26232, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26236, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26230, 0, 0, 32, 26, 3, height + 24, 0, 0, height + 22); + metal_a_supports_paint_setup(11, 5, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26234, 0, 0, 32, 26, 3, height + 24, 0, 0, height + 22); + metal_a_supports_paint_setup(11, 6, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26231, 0, 0, 32, 26, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26235, 0, 0, 32, 26, 3, height + 24, 0, 6, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26231, 0, 0, 32, 26, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26235, 0, 0, 32, 26, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26230, 0, 0, 32, 26, 3, height + 24, 0, 0, height + 22); + metal_a_supports_paint_setup(11, 5, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26234, 0, 0, 32, 26, 3, height + 24, 0, 0, height + 22); + metal_a_supports_paint_setup(11, 6, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26232, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26236, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26229, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26233, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15824, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15828, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15827, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15831, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15825, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(11, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15829, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(11, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15826, 0, 0, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15830, 0, 0, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15826, 0, 0, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15830, 0, 0, 32, 26, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15825, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(11, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15829, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(11, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15827, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15831, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15824, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15828, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26237, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26241, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26240, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26244, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26238, 0, 0, 32, 26, 3, height + 24, 0, 6, height + 22); + metal_a_supports_paint_setup(11, 8, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26242, 0, 0, 32, 26, 3, height + 24, 0, 6, height + 22); + metal_a_supports_paint_setup(11, 7, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26239, 0, 0, 32, 26, 3, height + 24, 0, 0, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26243, 0, 0, 32, 26, 3, height + 24, 0, 0, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26239, 0, 0, 32, 26, 3, height + 24, 0, 0, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26243, 0, 0, 32, 26, 3, height + 24, 0, 0, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26238, 0, 0, 32, 26, 3, height + 24, 0, 6, height + 22); + metal_a_supports_paint_setup(11, 8, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26242, 0, 0, 32, 26, 3, height + 24, 0, 6, height + 22); + metal_a_supports_paint_setup(11, 7, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26240, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26244, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26237, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26241, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15959, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15962, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15965, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15956, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15958, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15961, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15964, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15955, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15957, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15960, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15963, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15954, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26326, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26329, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26332, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26323, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26325, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26328, 0, 0, 16, 16, 3, height + 24, 0, 0, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26331, 0, 0, 16, 16, 3, height + 24, 0, 16, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26322, 0, 0, 16, 16, 3, height + 24, 16, 16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26324, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26327, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26330, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26321, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 22); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + multi_dimension_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15971, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15978, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15974, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15977, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15968, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15970, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15973, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15976, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15967, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15969, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15972, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15975, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15979, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15966, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26338, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26341, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26344, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26335, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26337, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26340, 0, 0, 16, 16, 3, height + 24, 0, 0, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26343, 0, 0, 16, 16, 3, height + 24, 0, 16, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26334, 0, 0, 16, 16, 3, height + 24, 16, 16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26336, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26339, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26342, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26333, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 22); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + multi_dimension_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16197, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16204, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16200, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16203, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16194, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16196, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16199, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16202, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16193, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16195, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16198, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16201, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16205, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16192, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16194, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16197, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16204, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16200, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16203, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16193, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16196, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16199, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16202, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16192, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16195, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16198, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16201, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16205, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16197, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16204, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16200, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16203, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16194, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16196, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16199, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16202, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16193, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16195, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16198, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16201, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16205, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16192, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16194, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16197, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16204, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16200, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16203, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16193, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16196, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16199, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16202, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16192, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16195, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16198, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16201, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16205, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16178, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16181, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16184, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16187, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16191, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16179, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16182, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16185, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16188, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16180, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16183, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16190, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16186, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16189, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16181, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16184, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16187, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16191, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16178, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16182, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16185, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16188, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16179, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16183, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16190, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16186, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16189, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16180, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16178, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16181, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16184, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16187, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16191, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16179, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16182, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16185, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16188, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16180, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16183, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16190, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16186, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16189, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16181, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16184, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16187, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16191, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16178, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16182, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16185, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16188, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16179, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16183, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16190, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16186, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16189, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16180, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + multi_dimension_rc_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + multi_dimension_rc_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16165, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16176, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16170, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16175, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16160, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16164, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16169, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16174, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16159, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16163, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16168, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16173, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16158, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16162, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16167, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16172, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16157, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16161, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16166, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16171, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16177, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16156, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16160, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16165, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16176, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16170, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16175, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16159, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16164, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16169, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16174, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16158, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16163, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16168, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16173, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16157, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16162, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16167, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16172, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16156, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16161, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16166, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16171, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16177, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16165, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16176, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16170, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16175, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16160, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16164, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16169, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16174, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16159, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16163, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16168, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16173, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16158, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16162, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16167, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16172, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16157, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16161, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16166, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16171, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16177, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16156, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16160, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16165, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16176, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16170, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16175, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16159, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16164, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16169, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16174, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16158, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16163, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16168, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16173, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16157, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16162, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16167, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16172, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16156, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16161, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16166, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16171, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16177, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16134, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16139, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16144, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16149, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16155, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16135, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16140, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16145, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16150, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16136, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16141, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16146, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16151, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16137, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16142, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16147, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16152, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16138, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16143, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16154, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16148, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16153, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16139, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16144, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16149, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16155, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16134, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16140, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16145, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16150, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16135, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16141, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16146, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16151, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16136, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16142, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16147, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16152, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16137, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16143, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16154, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16148, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16153, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16138, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16134, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16139, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16144, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16149, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16155, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16135, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16140, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16145, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16150, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16136, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16141, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16146, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16151, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16137, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16142, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16147, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16152, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16138, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16143, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16154, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16148, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16153, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16139, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16144, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16149, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16155, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16134, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16140, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16145, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16150, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16135, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16141, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16146, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16151, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16136, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16142, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16147, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16152, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16137, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16143, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16154, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16148, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16153, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16138, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + multi_dimension_rc_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + multi_dimension_rc_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16218, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16219, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + 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); + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26549, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26550, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + } +} + +static void multi_dimension_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (direction) { + case 0: + 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] | 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); + 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); + } else { + switch (direction) { + case 0: + 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] | 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); + 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); + } +} + +static void multi_dimension_rc_track_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16130, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16131, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16132, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16133, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + } + paint_util_set_vertical_tunnel(height + 32); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26533, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 56); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26534, 0, 0, 32, 2, 31, height + 24, 0, 4, height + 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26535, 0, 0, 32, 2, 31, height + 24, 0, 4, height + 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26536, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 56); + break; + } + paint_util_set_vertical_tunnel(height + 32); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + break; + } + } +} + +static void multi_dimension_rc_track_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + multi_dimension_rc_track_90_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_60_deg_up_to_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16122, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16123, 0, 0, 2, 20, 55, height, 24, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16124, 0, 0, 2, 20, 55, height, 24, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16125, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_vertical_tunnel(height + 48); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26525, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 80); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26526, 0, 0, 32, 2, 55, height + 24, 0, 4, height + 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26527, 0, 0, 32, 2, 55, height + 24, 0, 4, height + 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26528, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 80); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_vertical_tunnel(height + 48); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + break; + } + } +} + +static void multi_dimension_rc_track_90_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + multi_dimension_rc_track_60_deg_up_to_90_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_90_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16126, 0, 0, 6, 20, 3, height, 0, 6, height + 2); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16127, 0, 0, 2, 20, 31, height, 39, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16128, 0, 0, 2, 20, 31, height, 39, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16129, 0, 0, 6, 20, 3, height, 0, 6, height + 2); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height + 48, TUNNEL_8); + break; + case 2: + paint_util_push_tunnel_left(height + 48, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26529, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 80); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26530, 0, 0, 32, 2, 55, height + 24, 0, 4, height + 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26531, 0, 0, 32, 2, 55, height + 24, 0, 4, height + 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26532, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 80); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height + 48, TUNNEL_5); + break; + case 2: + paint_util_push_tunnel_left(height + 48, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 96, 0x20); + } +} + +static void multi_dimension_rc_track_60_deg_down_to_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16128, 0, 0, 2, 20, 31, height, 39, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16129, 0, 0, 6, 20, 3, height, 0, 6, height + 2); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16126, 0, 0, 6, 20, 3, height, 0, 6, height + 2); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16127, 0, 0, 2, 20, 31, height, 39, 6, height + 8); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 48, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 1: + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26531, 0, 0, 32, 2, 55, height + 24, 0, 4, height + 6); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26532, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 80); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26529, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 80); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26530, 0, 0, 32, 2, 55, height + 24, 0, 4, height + 6); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 48, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 96, 0x20); + break; + case 1: + break; + } + } +} + +static void multi_dimension_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15996, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16000, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16004, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16008, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15997, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16001, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16005, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16009, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15998, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16002, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16006, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16010, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15999, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16003, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16007, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16011, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26405, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26409, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26413, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26417, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26406, 0, 0, 32, 16, 3, height + 24, 0, 0, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26410, 0, 0, 34, 16, 3, height + 24, 0, 0, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26414, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26418, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26407, 0, 0, 16, 16, 3, height + 24, 0, 16, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26411, 0, 0, 16, 16, 3, height + 24, 16, 16, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26415, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26419, 0, 0, 16, 16, 3, height + 24, 0, 0, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26408, 0, 0, 16, 16, 3, height + 24, 16, 16, height + 22); + metal_a_supports_paint_setup(11, 3, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26412, 0, 0, 16, 18, 3, height + 24, 0, 16, height + 22); + metal_a_supports_paint_setup(11, 1, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26416, 0, 0, 16, 16, 3, height + 24, 0, 0, height + 22); + metal_a_supports_paint_setup(11, 0, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26420, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 22); + metal_a_supports_paint_setup(11, 2, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15980, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15984, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15988, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15992, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15981, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15985, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15989, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15993, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15982, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15986, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15990, 0, 0, 28, 28, 3, height, 4, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15994, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15983, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15987, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15991, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15995, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26389, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26393, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26397, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26401, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26390, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26394, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26398, 0, 0, 34, 16, 3, height + 24, 0, 0, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26402, 0, 0, 32, 16, 3, height + 24, 0, 0, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26391, 0, 0, 16, 16, 3, height + 24, 0, 0, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26395, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26399, 0, 0, 28, 28, 3, height + 24, 4, 4, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26403, 0, 0, 16, 16, 3, height + 24, 0, 16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26392, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 22); + metal_a_supports_paint_setup(11, 1, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26396, 0, 0, 16, 16, 3, height + 24, 0, 0, height + 22); + metal_a_supports_paint_setup(11, 0, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26400, 0, 0, 16, 18, 3, height + 24, 0, 16, height + 22); + metal_a_supports_paint_setup(11, 2, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26404, 0, 0, 16, 16, 3, height + 24, 16, 16, height + 22); + metal_a_supports_paint_setup(11, 3, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + multi_dimension_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + multi_dimension_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16028, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16032, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16036, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16040, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16029, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16033, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16037, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16041, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16030, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16034, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16038, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16042, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16031, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16035, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16039, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16043, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26437, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26441, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26445, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26449, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26438, 0, 0, 32, 16, 3, height + 24, 0, 0, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26442, 0, 0, 34, 16, 3, height + 24, 0, 0, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26446, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26450, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26439, 0, 0, 16, 16, 3, height + 24, 0, 16, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26443, 0, 0, 16, 16, 3, height + 24, 16, 16, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26447, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26451, 0, 0, 16, 16, 3, height + 24, 0, 0, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26440, 0, 0, 16, 16, 3, height + 24, 16, 16, height + 22); + metal_a_supports_paint_setup(11, 3, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26444, 0, 0, 16, 18, 3, height + 24, 0, 16, height + 22); + metal_a_supports_paint_setup(11, 1, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26448, 0, 0, 16, 16, 3, height + 24, 0, 0, height + 22); + metal_a_supports_paint_setup(11, 0, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26452, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 22); + metal_a_supports_paint_setup(11, 2, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16012, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16016, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16020, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16024, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16013, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16017, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16021, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16025, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16014, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16018, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16022, 0, 0, 28, 28, 0, height, 4, 4, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16026, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16015, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16019, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16023, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16027, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26421, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26425, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26429, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26433, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26422, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26426, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26430, 0, 0, 34, 16, 3, height + 24, 0, 0, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26434, 0, 0, 32, 16, 3, height + 24, 0, 0, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26423, 0, 0, 16, 16, 3, height + 24, 0, 0, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26427, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26431, 0, 0, 28, 28, 3, height + 24, 4, 4, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26435, 0, 0, 16, 16, 3, height + 24, 0, 16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26424, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 22); + metal_a_supports_paint_setup(11, 1, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26428, 0, 0, 16, 16, 3, height + 24, 0, 0, height + 22); + metal_a_supports_paint_setup(11, 0, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26432, 0, 0, 16, 18, 3, height + 24, 0, 16, height + 22); + metal_a_supports_paint_setup(11, 2, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26436, 0, 0, 16, 16, 3, height + 24, 16, 16, height + 22); + metal_a_supports_paint_setup(11, 3, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + multi_dimension_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + multi_dimension_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void multi_dimension_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16109, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16047, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16106, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16044, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16108, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16046, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16107, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16045, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26484, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26456, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26481, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26453, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26483, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26455, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26482, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + metal_a_supports_paint_setup(11, 0, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26454, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + metal_a_supports_paint_setup(11, 0, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16121, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16059, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16118, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16056, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16120, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16058, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16119, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16057, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26496, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 40); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26468, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 40); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26493, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 40); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26465, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 40); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26495, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 40); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26467, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 40); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26494, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 40); + metal_a_supports_paint_setup(11, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26466, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 40); + metal_a_supports_paint_setup(11, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16071, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16068, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16070, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16069, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26480, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 88); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26477, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 88); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26479, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 88); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 32, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26478, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 24); + metal_b_supports_paint_setup(11, 0, 36, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 32, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 36, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16113, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16051, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16110, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16048, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16112, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16050, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16111, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16049, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26488, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26460, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26485, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26457, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26487, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26459, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26486, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(11, 0, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26458, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(11, 0, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16063, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16060, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16062, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16061, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26472, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 56); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26469, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 56); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26471, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 56); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 16, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26470, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 56); + metal_b_supports_paint_setup(11, 0, 16, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 16, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 16, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16067, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16064, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16066, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16065, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(11, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26476, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 56); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26473, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 56); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26475, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 56); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 21, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26474, -16, -16, 16, 16, 3, height + 24, 0, 0, height + 56); + metal_b_supports_paint_setup(11, 0, 21, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 21, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 21, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16117, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16055, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16114, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16052, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16116, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16054, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16115, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16053, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26492, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26464, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26489, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26461, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26491, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26463, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26490, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(11, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26462, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(11, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16119, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16057, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16120, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16058, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16118, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16056, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16121, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16059, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26466, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 40); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26467, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 40); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26465, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 40); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26468, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 40); + metal_a_supports_paint_setup(11, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16069, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16070, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16068, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16071, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26478, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26479, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 88); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26477, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 88); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 24, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26480, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 88); + metal_b_supports_paint_setup(11, 0, 28, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 24, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 28, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16115, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16053, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16116, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16054, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16114, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16052, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16117, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16055, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26462, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26463, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26461, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26464, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(11, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16065, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16066, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16064, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16067, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26474, -16, -16, 16, 16, 3, height + 24, 0, 0, height + 56); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26475, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 56); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26473, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 56); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 17, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26476, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 56); + metal_b_supports_paint_setup(11, 0, 17, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 17, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 17, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16061, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16062, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16060, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16063, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26470, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 56); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26471, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 56); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26469, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 56); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26472, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 56); + metal_b_supports_paint_setup(11, 0, 8, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16111, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16049, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16112, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16050, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16110, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16048, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16113, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16051, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26458, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26459, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26457, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26460, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(11, 0, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16079, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16076, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16080, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16078, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16077, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26504, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26501, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26503, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26502, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + metal_a_supports_paint_setup(11, 0, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16084, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16081, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16083, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16085, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16082, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26508, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26505, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26507, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26506, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + metal_a_supports_paint_setup(11, 0, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16082, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16083, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16085, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16081, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16084, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26506, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26507, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26505, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26508, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + metal_a_supports_paint_setup(11, 0, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16077, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16078, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16076, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16080, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16079, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26502, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26503, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26501, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26504, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + metal_a_supports_paint_setup(11, 0, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16099, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16096, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16100, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16098, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16097, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26520, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26517, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26519, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26518, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(11, 0, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16104, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16101, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16103, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16105, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16102, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26524, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26521, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26523, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26522, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(11, 0, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16089, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16086, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16090, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16088, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16087, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26512, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26509, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26511, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26510, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(11, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16094, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16091, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16093, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16095, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16092, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26516, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26513, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26515, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26514, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(11, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16092, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16093, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16095, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16091, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16094, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26514, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26515, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26513, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26516, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(11, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16087, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16088, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16086, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16090, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16089, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26510, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26511, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26509, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26512, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(11, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16102, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16103, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16105, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16101, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16104, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26522, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26523, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26521, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26524, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(11, 0, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16097, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16098, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16096, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16100, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16099, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26518, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26519, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26517, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26520, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 32); + metal_a_supports_paint_setup(11, 0, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16075, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16072, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16074, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16073, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26500, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26497, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26499, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26498, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + metal_a_supports_paint_setup(11, 0, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16073, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16074, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16072, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16075, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26498, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26499, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26497, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26500, -16, -16, 32, 32, 3, height + 24, -16, -16, height + 22); + metal_a_supports_paint_setup(11, 0, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_left_flyer_twist_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26368, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26374, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26367, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26373, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26369, 0, 6, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26375, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26366, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26372, 0, 6, 32, 20, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26370, 0, 6, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26376, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26365, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26371, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26368, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26374, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26367, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26373, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26369, 0, 6, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26375, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26366, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26372, 0, 6, 32, 20, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26370, 0, 6, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26376, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26365, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26371, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_right_flyer_twist_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26380, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26386, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26379, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26385, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26381, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26387, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26378, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26384, 0, 6, 32, 20, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26382, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26388, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26377, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26383, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26380, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26386, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26379, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26385, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26381, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26387, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26378, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26384, 0, 6, 32, 20, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26382, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26388, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26377, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26383, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_left_flyer_twist_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26365, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26371, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26370, 0, 6, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26376, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26366, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26372, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26369, 0, 6, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26375, 0, 6, 32, 20, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26367, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26373, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26368, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26374, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26365, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26371, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26370, 0, 6, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26376, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26366, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26372, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26369, 0, 6, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26375, 0, 6, 32, 20, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26367, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26373, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26368, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26374, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_right_flyer_twist_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26377, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26383, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26382, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26388, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26378, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26384, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26381, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26387, 0, 6, 32, 20, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26379, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26385, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26380, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26386, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26377, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26383, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26382, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26388, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26378, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26384, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26381, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26387, 0, 6, 32, 20, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26379, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26385, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26380, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26386, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_multidim_inverted_flat_to_90_deg_quarter_loop_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26539, 0, 0, 32, 20, 3, height + 16, 0, 6, height + 16); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26542, 0, 0, 2, 20, 3, height + 16, 0, 6, height + 18); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26545, 0, 0, 2, 20, 3, height + 16, 0, 6, height + 18); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26548, 0, 0, 32, 20, 3, height + 16, 0, 6, height + 16); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 32, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26538, 0, 0, 2, 20, 31, height + 16, 24, 6, height + 16); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26541, 0, 0, 2, 20, 3, height + 16, 0, 6, height + 18); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26544, 0, 0, 2, 20, 3, height + 16, 0, 6, height + 18); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26547, 0, 0, 2, 20, 31, height + 16, 24, 6, height + 16); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26537, 0, 0, 2, 20, 31, height + 16, 28, 6, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26540, 0, 0, 2, 20, 31, height + 16, 0, 6, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26543, 0, 0, 2, 20, 31, height + 16, 0, 6, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26546, 0, 0, 2, 20, 31, height + 16, 29, 6, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16208, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16211, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16214, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16217, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 16, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16207, 0, 0, 2, 20, 31, height, -8, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16210, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16213, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16216, 0, 0, 2, 20, 31, height, -8, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16206, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16209, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16212, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16215, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + break; + } + } +} + +static void multi_dimension_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16220, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16221, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + 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); + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26551, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26552, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 36, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + } +} + +static void multi_dimension_rc_track_multidim_90_deg_up_to_inverted_flat_quarter_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16206, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16209, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16212, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16215, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16207, 0, 0, 2, 20, 31, height, -8, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16210, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16213, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16216, 0, 0, 2, 20, 31, height, -8, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16208, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16211, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16214, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16217, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 16, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26537, 0, 0, 2, 20, 31, height - 16, 28, 6, height - 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26540, 0, 0, 2, 20, 31, height - 16, 0, 6, height - 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26543, 0, 0, 2, 20, 31, height - 16, 0, 6, height - 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26546, 0, 0, 2, 20, 31, height - 16, 28, 6, height - 8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26538, 0, 0, 2, 20, 31, height - 16, 24, 6, height - 16); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26541, 0, 0, 2, 20, 63, height - 16, 0, 6, height - 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26544, 0, 0, 2, 20, 63, height - 16, 0, 6, height - 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26547, 0, 0, 2, 20, 31, height - 16, 24, 6, height - 16); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26539, 0, 0, 32, 20, 3, height - 16, 0, 6, height - 16); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26542, 0, 0, 2, 20, 31, height - 16, 0, 6, height - 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26545, 0, 0, 2, 20, 31, height - 16, 0, 6, height - 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26548, 0, 0, 32, 20, 3, height - 16, 0, 6, height - 16); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +static void multi_dimension_rc_track_multidim_flat_to_90_deg_down_quarter_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26539, 0, 0, 32, 20, 3, height + 16, 0, 6, height + 16); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26542, 0, 0, 2, 20, 3, height + 16, 0, 6, height + 18); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26545, 0, 0, 2, 20, 3, height + 16, 0, 6, height + 18); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26548, 0, 0, 32, 20, 3, height + 16, 0, 6, height + 16); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 32, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26538, 0, 0, 2, 20, 31, height + 16, 24, 6, height + 16); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26541, 0, 0, 2, 20, 3, height + 16, 0, 6, height + 18); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26544, 0, 0, 2, 20, 3, height + 16, 0, 6, height + 18); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26547, 0, 0, 2, 20, 31, height + 16, 24, 6, height + 16); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26537, 0, 0, 2, 20, 31, height + 16, 28, 6, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26540, 0, 0, 2, 20, 31, height + 16, 0, 6, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26543, 0, 0, 2, 20, 31, height + 16, 0, 6, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26546, 0, 0, 2, 20, 31, height + 16, 29, 6, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16208, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16211, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16214, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16217, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 16, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16207, 0, 0, 2, 20, 31, height, -8, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16210, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16213, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16216, 0, 0, 2, 20, 31, height, -8, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16206, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16209, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16212, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16215, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + break; + } + } +} + +static void multi_dimension_rc_track_elem_255(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (!track_element_is_inverted(mapElement)) { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16206, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16209, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16212, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16215, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16207, 0, 0, 2, 20, 31, height, -8, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16210, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16213, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16216, 0, 0, 2, 20, 31, height, -8, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16208, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16211, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16214, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16217, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 16, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } + } else { + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26537, 0, 0, 2, 20, 31, height - 16, 28, 6, height - 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26540, 0, 0, 2, 20, 31, height - 16, 0, 6, height - 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26543, 0, 0, 2, 20, 31, height - 16, 0, 6, height - 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26546, 0, 0, 2, 20, 31, height - 16, 28, 6, height - 8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26538, 0, 0, 2, 20, 31, height - 16, 24, 6, height - 16); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26541, 0, 0, 2, 20, 63, height - 16, 0, 6, height - 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26544, 0, 0, 2, 20, 63, height - 16, 0, 6, height - 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26547, 0, 0, 2, 20, 31, height - 16, 24, 6, height - 16); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26539, 0, 0, 32, 20, 3, height - 16, 0, 6, height - 16); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26542, 0, 0, 2, 20, 31, height - 16, 0, 6, height - 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26545, 0, 0, 2, 20, 31, height - 16, 0, 6, height - 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26548, 0, 0, 32, 20, 3, height - 16, 0, 6, height - 16); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } + } +} + +TRACK_PAINT_FUNCTION get_track_paint_function_multi_dimension_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return multi_dimension_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return multi_dimension_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return multi_dimension_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return multi_dimension_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return multi_dimension_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return multi_dimension_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return multi_dimension_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return multi_dimension_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return multi_dimension_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return multi_dimension_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return multi_dimension_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return multi_dimension_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return multi_dimension_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return multi_dimension_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return multi_dimension_rc_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return multi_dimension_rc_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return multi_dimension_rc_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return multi_dimension_rc_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return multi_dimension_rc_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return multi_dimension_rc_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return multi_dimension_rc_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return multi_dimension_rc_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return multi_dimension_rc_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return multi_dimension_rc_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return multi_dimension_rc_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return multi_dimension_rc_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return multi_dimension_rc_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return multi_dimension_rc_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return multi_dimension_rc_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return multi_dimension_rc_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return multi_dimension_rc_track_right_bank; + case TRACK_ELEM_S_BEND_LEFT: + return multi_dimension_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return multi_dimension_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return multi_dimension_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return multi_dimension_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return multi_dimension_rc_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return multi_dimension_rc_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: + return multi_dimension_rc_track_left_half_banked_helix_up_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: + return multi_dimension_rc_track_right_half_banked_helix_up_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: + return multi_dimension_rc_track_left_half_banked_helix_down_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: + return multi_dimension_rc_track_right_half_banked_helix_down_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: + return multi_dimension_rc_track_left_half_banked_helix_up_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: + return multi_dimension_rc_track_right_half_banked_helix_up_large; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: + return multi_dimension_rc_track_left_half_banked_helix_down_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: + return multi_dimension_rc_track_right_half_banked_helix_down_large; + case TRACK_ELEM_BRAKES: + return multi_dimension_rc_track_brakes; + case TRACK_ELEM_ON_RIDE_PHOTO: + return multi_dimension_rc_track_on_ride_photo; + case TRACK_ELEM_90_DEG_UP: + return multi_dimension_rc_track_90_deg_up; + case TRACK_ELEM_90_DEG_DOWN: + return multi_dimension_rc_track_90_deg_down; + case TRACK_ELEM_60_DEG_UP_TO_90_DEG_UP: + return multi_dimension_rc_track_60_deg_up_to_90_deg_up; + case TRACK_ELEM_90_DEG_DOWN_TO_60_DEG_DOWN: + return multi_dimension_rc_track_90_deg_down_to_60_deg_down; + case TRACK_ELEM_90_DEG_UP_TO_60_DEG_UP: + return multi_dimension_rc_track_90_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_DOWN_TO_90_DEG_DOWN: + return multi_dimension_rc_track_60_deg_down_to_90_deg_down; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return multi_dimension_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return multi_dimension_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return multi_dimension_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return multi_dimension_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + return multi_dimension_rc_track_left_eighth_bank_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + return multi_dimension_rc_track_right_eighth_bank_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + return multi_dimension_rc_track_left_eighth_bank_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + return multi_dimension_rc_track_right_eighth_bank_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return multi_dimension_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return multi_dimension_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP: + return multi_dimension_rc_track_diag_60_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return multi_dimension_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + return multi_dimension_rc_track_diag_25_deg_up_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + return multi_dimension_rc_track_diag_60_deg_up_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return multi_dimension_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return multi_dimension_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN: + return multi_dimension_rc_track_diag_60_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return multi_dimension_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + return multi_dimension_rc_track_diag_25_deg_down_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + return multi_dimension_rc_track_diag_60_deg_down_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return multi_dimension_rc_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + return multi_dimension_rc_track_diag_flat_to_left_bank; + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + return multi_dimension_rc_track_diag_flat_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + return multi_dimension_rc_track_diag_left_bank_to_flat; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + return multi_dimension_rc_track_diag_right_bank_to_flat; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + return multi_dimension_rc_track_diag_left_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + return multi_dimension_rc_track_diag_right_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + return multi_dimension_rc_track_diag_25_deg_up_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + return multi_dimension_rc_track_diag_25_deg_up_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + return multi_dimension_rc_track_diag_left_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + return multi_dimension_rc_track_diag_right_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + return multi_dimension_rc_track_diag_25_deg_down_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + return multi_dimension_rc_track_diag_25_deg_down_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK: + return multi_dimension_rc_track_diag_left_bank; + case TRACK_ELEM_DIAG_RIGHT_BANK: + return multi_dimension_rc_track_diag_right_bank; + case TRACK_ELEM_LEFT_FLYER_TWIST_UP: + return multi_dimension_rc_track_left_flyer_twist_up; + case TRACK_ELEM_RIGHT_FLYER_TWIST_UP: + return multi_dimension_rc_track_right_flyer_twist_up; + case TRACK_ELEM_LEFT_FLYER_TWIST_DOWN: + return multi_dimension_rc_track_left_flyer_twist_down; + case TRACK_ELEM_RIGHT_FLYER_TWIST_DOWN: + return multi_dimension_rc_track_right_flyer_twist_down; + case TRACK_ELEM_MULTIDIM_INVERTED_FLAT_TO_90_DEG_QUARTER_LOOP_DOWN: + return multi_dimension_rc_track_multidim_inverted_flat_to_90_deg_quarter_loop_down; + case TRACK_ELEM_BLOCK_BRAKES: + return multi_dimension_rc_track_block_brakes; + case TRACK_ELEM_MULTIDIM_90_DEG_UP_TO_INVERTED_FLAT_QUARTER_LOOP: + return multi_dimension_rc_track_multidim_90_deg_up_to_inverted_flat_quarter_loop; + case TRACK_ELEM_MULTIDIM_FLAT_TO_90_DEG_DOWN_QUARTER_LOOP: + return multi_dimension_rc_track_multidim_flat_to_90_deg_down_quarter_loop; + case TRACK_ELEM_255: + return multi_dimension_rc_track_elem_255; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 7d55514da1..36d97c95cb 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6296,7 +6296,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { 0, // RIDE_TYPE_WOODEN_ROLLER_COASTER get_track_paint_function_side_friction_rc, // RIDE_TYPE_SIDE_FRICTION_ROLLER_COASTER get_track_paint_function_wild_mouse, // RIDE_TYPE_WILD_MOUSE - 0, // RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER + get_track_paint_function_multi_dimension_rc, // RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER 0, // RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER_ALT 0, // RIDE_TYPE_FLYING_ROLLER_COASTER 0, // RIDE_TYPE_FLYING_ROLLER_COASTER_ALT diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index a57003aae2..f38613613d 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -305,6 +305,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_ghost_train(int trackType, int dir TRACK_PAINT_FUNCTION get_track_paint_function_twister_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_side_friction_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_wild_mouse(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_multi_dimension_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_virginia_reel(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_splash_boats(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_mini_helicopters(int trackType, int direction); From 646691601164b0bbd0e112416a7fdf5246a30f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:42:36 +0200 Subject: [PATCH 16/55] Add generated Flying RC --- src/ride/coaster/flying_roller_coaster.c | 6875 ++++++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 6877 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/flying_roller_coaster.c b/src/ride/coaster/flying_roller_coaster.c index 846fd9695d..7031936396 100644 --- a/src/ride/coaster/flying_roller_coaster.c +++ b/src/ride/coaster/flying_roller_coaster.c @@ -13,3 +13,6878 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void flying_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17486, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17487, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17488, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17489, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17146, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17147, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void flying_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17204, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17205, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17206, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17207, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void flying_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17220, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17221, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17222, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17223, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void flying_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17196, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17197, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17198, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17199, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void flying_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17208, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17209, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17212, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17210, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17213, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17211, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void flying_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17214, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17215, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17218, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17216, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17219, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17217, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void flying_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17200, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17201, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17202, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17203, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void flying_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17259, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17264, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17269, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17254, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17258, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17263, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17268, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17253, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17257, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17262, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17267, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17252, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17256, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17261, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17266, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17251, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17255, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17260, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17265, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17250, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + flying_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void flying_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17156, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17164, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17157, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17165, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17158, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17159, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void flying_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17160, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17161, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17162, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17166, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17163, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17167, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void flying_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17162, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17166, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17163, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17167, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17160, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17161, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void flying_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17158, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17159, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17156, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17164, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17157, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17165, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void flying_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17279, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17290, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17284, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17289, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17274, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17278, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17283, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17288, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17273, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17277, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17282, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17287, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17272, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17276, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17281, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17286, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17271, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17275, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17280, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17285, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17291, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17270, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + flying_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void flying_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17168, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17172, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17169, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17173, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17170, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17171, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void flying_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17174, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17175, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17176, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17178, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17177, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17179, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void flying_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17180, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17184, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17181, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17185, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17182, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17183, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void flying_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17186, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17187, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17188, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17190, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17189, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17191, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void flying_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17192, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17193, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17194, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17195, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void flying_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17344, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17349, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17354, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17359, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17345, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17350, 0, 0, 32, 16, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17355, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17360, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17346, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17351, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17356, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17361, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17347, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17352, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17357, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17362, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17348, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17353, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17358, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17363, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void flying_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17324, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17329, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17334, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17339, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17325, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17330, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17335, 0, 0, 32, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17340, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17326, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17331, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17336, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17341, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17327, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17332, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17337, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17342, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17328, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17333, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17338, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17343, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void flying_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + flying_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void flying_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + flying_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void flying_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17308, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17312, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17311, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17315, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17309, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17313, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17310, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17314, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17310, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17314, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17309, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17313, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17311, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17315, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17308, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17312, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17316, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17320, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17319, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17323, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17317, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(11, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17321, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(11, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17318, 0, 0, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17322, 0, 0, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17318, 0, 0, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17322, 0, 0, 32, 26, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17317, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(11, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17321, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(11, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17319, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17323, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17316, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17320, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17229, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17232, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17235, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17226, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17228, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17231, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17234, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17225, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17227, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17230, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17233, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17224, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + flying_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void flying_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17241, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17248, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17244, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17247, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17238, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17240, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17243, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17246, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17237, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17239, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17242, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17245, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17249, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17236, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + flying_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void flying_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17375, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17377, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17379, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17373, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17374, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17376, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17378, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17372, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void flying_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17364, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17366, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17368, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17370, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17365, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17367, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17369, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(11, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17371, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void flying_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + flying_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void flying_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + flying_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void flying_rc_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17399, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17406, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17402, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17405, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17396, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17398, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17401, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17404, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17395, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17397, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17400, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17403, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17407, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17394, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17396, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17399, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17406, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17402, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17405, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17395, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17398, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17401, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17404, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17394, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17397, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17400, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17403, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17407, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17380, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17383, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17386, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17389, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17393, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17381, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17384, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17387, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17390, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17382, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17385, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17392, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17388, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17391, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17383, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17386, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17389, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17393, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17380, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17384, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17387, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17390, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17381, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17385, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17392, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17388, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17391, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17382, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + flying_rc_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void flying_rc_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + flying_rc_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void flying_rc_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17439, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17450, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17444, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17449, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17434, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17438, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17443, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17448, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17433, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17437, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17442, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17447, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17432, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17436, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17441, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17446, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17431, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17435, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17440, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17445, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17451, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17430, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17434, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17439, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17450, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17444, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17449, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17433, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17438, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17443, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17448, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17432, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17437, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17442, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17447, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17431, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17436, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17441, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17446, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17430, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17435, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17440, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17445, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17451, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17408, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17413, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17418, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17423, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17429, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17409, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17414, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17419, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17424, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17410, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17415, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17420, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17425, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17411, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17416, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17421, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17426, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17412, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17417, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17428, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17422, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17427, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17413, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17418, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17423, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17429, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17408, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17414, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17419, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17424, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17409, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17415, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17420, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17425, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17410, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17416, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17421, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17426, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17411, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17417, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17428, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17422, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17427, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17412, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + flying_rc_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void flying_rc_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + flying_rc_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void flying_rc_track_left_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17301, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17305, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17302, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17306, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17303, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17307, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17300, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17304, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_left(height - 8, TUNNEL_8); + break; + case 2: + paint_util_push_tunnel_right(height + 56, TUNNEL_7); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_7); + paint_util_push_tunnel_left(height + 56, TUNNEL_7); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void flying_rc_track_right_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17292, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17296, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17293, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17297, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17294, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17298, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17295, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17299, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 56, TUNNEL_7); + paint_util_push_tunnel_left(height - 8, TUNNEL_7); + break; + case 1: + paint_util_push_tunnel_left(height + 56, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_7); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void flying_rc_track_left_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_right_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void flying_rc_track_right_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_left_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void flying_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17148, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17149, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void flying_rc_track_left_quarter_banked_helix_large_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27202, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 30); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27207, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 30); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27212, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 30); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27197, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 30); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 41, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_9); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27201, 0, 0, 32, 16, 3, height + 24, 0, 0, height + 38); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27206, 0, 0, 32, 16, 3, height + 24, 0, 0, height + 38); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27211, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 38); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27196, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 38); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27200, 0, 0, 16, 16, 3, height + 24, 0, 16, height + 38); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27205, 0, 0, 16, 16, 3, height + 24, 16, 16, height + 38); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27210, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 38); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27195, 0, 0, 16, 16, 3, height + 24, 0, 0, height + 38); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27199, 0, 0, 16, 32, 3, height + 24, 16, 0, height + 38); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27204, 0, 0, 16, 32, 3, height + 24, 0, 0, height + 38); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27209, 0, 0, 16, 32, 3, height + 24, 0, 0, height + 38); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27194, 0, 0, 16, 32, 3, height + 24, 16, 0, height + 38); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27198, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 38); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27203, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 38); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27208, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 38); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27193, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 38); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 53, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 16, TUNNEL_9); + break; + case 3: + paint_util_push_tunnel_left(height + 16, TUNNEL_9); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void flying_rc_track_right_quarter_banked_helix_large_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27173, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 30); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27178, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 30); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27183, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 30); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27188, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 30); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 41, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_9); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27174, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 38); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27179, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 38); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27184, 0, 0, 32, 16, 3, height + 24, 0, 0, height + 38); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27189, 0, 0, 32, 16, 3, height + 24, 0, 0, height + 38); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27175, 0, 0, 16, 16, 3, height + 24, 0, 0, height + 38); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27180, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 38); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27185, 0, 0, 16, 16, 3, height + 24, 16, 16, height + 38); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27190, 0, 0, 16, 16, 3, height + 24, 0, 16, height + 38); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27176, 0, 0, 16, 32, 3, height + 24, 16, 0, height + 38); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27181, 0, 0, 16, 32, 3, height + 24, 0, 0, height + 38); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27186, 0, 0, 16, 32, 3, height + 24, 0, 0, height + 38); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27191, 0, 0, 16, 32, 3, height + 24, 16, 0, height + 38); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27177, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 38); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27182, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 38); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27187, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 38); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27192, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 38); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 53, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 16, TUNNEL_9); + break; + case 1: + paint_util_push_tunnel_left(height + 16, TUNNEL_9); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void flying_rc_track_left_quarter_banked_helix_large_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27182, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 38); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27187, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 38); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27192, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 38); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27177, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 38); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 53, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 16, TUNNEL_9); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27181, 0, 0, 32, 16, 3, height + 24, 0, 0, height + 38); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27186, 0, 0, 32, 16, 3, height + 24, 0, 0, height + 38); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27191, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 38); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27176, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 38); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27180, 0, 0, 16, 16, 3, height + 24, 0, 16, height + 38); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27185, 0, 0, 16, 16, 3, height + 24, 16, 16, height + 38); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27190, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 38); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27175, 0, 0, 16, 16, 3, height + 24, 0, 0, height + 38); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27179, 0, 0, 16, 32, 3, height + 24, 16, 0, height + 38); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27184, 0, 0, 16, 32, 3, height + 24, 0, 0, height + 38); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27189, 0, 0, 16, 32, 3, height + 24, 0, 0, height + 38); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27174, 0, 0, 16, 32, 3, height + 24, 16, 0, height + 38); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27178, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 30); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27183, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 30); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27188, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 30); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27173, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 30); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 41, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_9); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_9); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void flying_rc_track_right_quarter_banked_helix_large_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27193, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 38); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27198, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 38); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27203, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 38); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27208, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 38); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 53, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 16, TUNNEL_9); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27194, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 38); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27199, 0, 0, 32, 16, 3, height + 24, 0, 16, height + 38); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27204, 0, 0, 32, 16, 3, height + 24, 0, 0, height + 38); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27209, 0, 0, 32, 16, 3, height + 24, 0, 0, height + 38); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27195, 0, 0, 16, 16, 3, height + 24, 0, 0, height + 38); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27200, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 38); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27205, 0, 0, 16, 16, 3, height + 24, 16, 16, height + 38); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27210, 0, 0, 16, 16, 3, height + 24, 0, 16, height + 38); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27196, 0, 0, 16, 32, 3, height + 24, 16, 0, height + 38); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27201, 0, 0, 16, 32, 3, height + 24, 0, 0, height + 38); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27206, 0, 0, 16, 32, 3, height + 24, 0, 0, height + 38); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27211, 0, 0, 16, 32, 3, height + 24, 16, 0, height + 38); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27197, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 30); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27202, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 30); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27207, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 30); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27212, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 30); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 41, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_9); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_9); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void flying_rc_track_25_deg_up_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17914, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17915, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17916, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17917, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void flying_rc_track_25_deg_up_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17918, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17919, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17920, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17921, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void flying_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + 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] | 17146, 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] | 17147, 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] | 17146, 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] | 17147, 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); + 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); +} + +static void flying_rc_track_25_deg_down_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_25_deg_up_right_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_25_deg_down_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_25_deg_up_left_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17546, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17550, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17554, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17558, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17547, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17551, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17555, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17559, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17548, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17552, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17556, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17560, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17549, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17553, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17557, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17561, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17530, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17534, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17538, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17542, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17531, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17535, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17539, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17543, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17532, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17536, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17540, 0, 0, 28, 28, 3, height, 4, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17544, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17533, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17537, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17541, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17545, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + flying_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + flying_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void flying_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17578, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17582, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17586, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17590, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17579, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17583, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17587, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17591, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17580, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17584, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17588, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17592, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17581, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17585, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17589, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17593, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17562, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17566, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17570, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17574, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17563, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17567, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17571, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17575, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17564, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17568, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17572, 0, 0, 28, 28, 0, height, 4, 4, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17576, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17565, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17569, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17573, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17577, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + flying_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + flying_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void flying_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17861, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17791, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17858, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17788, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17860, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17790, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17859, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17789, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17873, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17803, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17870, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17800, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17872, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17802, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17871, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17801, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void flying_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17885, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17815, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17882, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17812, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17884, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17814, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17883, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17813, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void flying_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17865, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17795, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17862, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17792, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17864, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17794, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17863, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17793, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void flying_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17877, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17807, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17874, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17804, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17876, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17806, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17875, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17805, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void flying_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17881, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17811, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17878, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17808, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17880, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17810, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17879, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(11, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17809, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(11, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void flying_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17869, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17799, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17866, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17796, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17868, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17798, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17867, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17797, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void flying_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17871, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17801, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17872, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17802, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17870, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17800, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17873, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17803, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void flying_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17883, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17813, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17884, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17814, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17882, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17812, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17885, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17815, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void flying_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17867, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17797, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17868, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17798, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17866, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17796, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17869, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17799, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void flying_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17879, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17809, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17880, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17810, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17878, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17808, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17881, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17811, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void flying_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17875, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17805, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17876, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17806, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17874, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17804, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17877, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17807, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void flying_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17863, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17793, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17864, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17794, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17862, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17792, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17865, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17795, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void flying_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17831, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17828, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17832, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17830, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17829, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17836, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17833, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17835, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17837, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17834, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17834, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17835, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17837, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17833, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17836, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17829, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17830, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17828, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17832, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17831, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17851, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17848, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17852, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17850, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17849, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void flying_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17856, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17853, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17855, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17857, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17854, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void flying_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17841, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17838, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17842, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17840, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17839, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void flying_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17846, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17843, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17845, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17847, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17844, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void flying_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17844, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17845, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17847, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17843, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17846, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void flying_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17839, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17840, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17838, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17842, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17841, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void flying_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17854, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17855, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17857, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17853, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17856, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void flying_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17849, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17850, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17848, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17852, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17851, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void flying_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17827, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17824, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17826, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17825, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17825, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17826, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17824, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17827, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_left_flyer_twist_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27430, 0, 6, 32, 20, 3, height - 5); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27436, 0, 6, 32, 20, 3, height - 5); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27429, 0, 6, 32, 20, 3, height - 5); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27435, 0, 6, 32, 20, 3, height - 5); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height - 5, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27431, 0, 6, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27437, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27428, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27434, 0, 6, 32, 20, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27432, 0, 6, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27438, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27427, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27433, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 39, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_right_flyer_twist_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27442, 0, 6, 32, 20, 3, height - 5); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27448, 0, 6, 32, 20, 3, height - 5); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27441, 0, 6, 32, 20, 3, height - 5); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27447, 0, 6, 32, 20, 3, height - 5); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height - 5, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27443, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27449, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27440, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27446, 0, 6, 32, 20, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27444, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27450, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27439, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27445, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 39, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_left_flyer_twist_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27427, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27433, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27432, 0, 6, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27438, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 39, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27428, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27434, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27431, 0, 6, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27437, 0, 6, 32, 20, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27429, 0, 6, 32, 20, 3, height - 5); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27435, 0, 6, 32, 20, 3, height - 5); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27430, 0, 6, 32, 20, 3, height - 5); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27436, 0, 6, 32, 20, 3, height - 5); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height - 5, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_right_flyer_twist_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27439, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27445, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27444, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27450, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 39, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27440, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27446, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27443, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27449, 0, 6, 32, 20, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27441, 0, 6, 32, 20, 3, height - 5); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27447, 0, 6, 32, 20, 3, height - 5); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27442, 0, 6, 32, 20, 3, height - 5); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27448, 0, 6, 32, 20, 3, height - 5); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height - 5, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void flying_rc_track_flyer_half_loop_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17626, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17634, 0, 6, 32, 20, 11, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17633, 0, 6, 32, 20, 9, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17641, 0, 6, 32, 20, 7, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17627, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(11, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17635, 0, 14, 3, 20, 63, height, 28, 6, height); + metal_a_supports_paint_setup(11, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17632, 0, 6, 3, 20, 63, height, 28, 6, height); + metal_a_supports_paint_setup(11, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17640, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(11, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17628, 16, 0, 2, 16, 119, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17636, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17631, 10, 16, 4, 12, 119, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17639, 16, 16, 2, 16, 119, height, 15, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17629, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17637, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17630, 0, 16, 32, 12, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17638, 0, 16, 32, 12, 3, height + 32); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void flying_rc_track_flyer_half_loop_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17629, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17637, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17630, 0, 16, 32, 12, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17638, 0, 16, 32, 12, 3, height + 32); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17628, 16, 0, 2, 16, 119, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17636, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17631, 10, 16, 4, 12, 119, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17639, 16, 16, 2, 16, 119, height, 15, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17627, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(11, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17635, 0, 14, 3, 20, 63, height, 28, 6, height); + metal_a_supports_paint_setup(11, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17632, 0, 6, 3, 20, 63, height, 28, 6, height); + metal_a_supports_paint_setup(11, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17640, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(11, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17626, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17634, 0, 6, 32, 20, 11, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17633, 0, 6, 32, 20, 9, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17641, 0, 6, 32, 20, 7, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void flying_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17150, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17151, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void flying_rc_track_left_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18025, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18027, 0, 6, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18029, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18023, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18024, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18026, 6, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18028, 6, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18022, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void flying_rc_track_right_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18014, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18016, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18018, 0, 6, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18020, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18015, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18017, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18019, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(11, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18021, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void flying_rc_track_left_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + flying_rc_track_right_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void flying_rc_track_right_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + flying_rc_track_left_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void flying_rc_track_left_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17978, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17983, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17988, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17993, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17979, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17984, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17989, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17994, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17980, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17985, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17990, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17995, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17981, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17986, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17991, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17996, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17982, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17987, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17992, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17997, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void flying_rc_track_right_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17958, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17963, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17968, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17973, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17959, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17964, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17969, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17974, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17960, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17965, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17970, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17975, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17961, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17966, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17971, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17976, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17962, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17967, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17972, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17977, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void flying_rc_track_left_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + flying_rc_track_right_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void flying_rc_track_right_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + flying_rc_track_left_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void flying_rc_track_25_deg_up_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17922, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17923, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17930, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17924, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17925, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void flying_rc_track_25_deg_up_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17926, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17927, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17928, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17931, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17929, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void flying_rc_track_left_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17932, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17933, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17940, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17934, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17935, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void flying_rc_track_right_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17936, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17937, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17938, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17941, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17939, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void flying_rc_track_25_deg_down_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_right_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_25_deg_down_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_left_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_left_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_25_deg_up_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_right_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_25_deg_up_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_left_banked_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17942, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17943, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17944, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17945, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void flying_rc_track_right_banked_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17946, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17947, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17948, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17949, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void flying_rc_track_left_banked_25_deg_up_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17950, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17951, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17952, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17953, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void flying_rc_track_right_banked_25_deg_up_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17954, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17955, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17956, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17957, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void flying_rc_track_left_banked_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_right_banked_25_deg_up_to_right_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_right_banked_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_left_banked_25_deg_up_to_left_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_left_banked_25_deg_down_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_right_banked_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_right_banked_25_deg_down_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_left_banked_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17894, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17895, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17902, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17896, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17897, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void flying_rc_track_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17898, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17899, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17900, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17903, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17901, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void flying_rc_track_left_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17904, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17905, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17912, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17906, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17907, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void flying_rc_track_right_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17908, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17909, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17910, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17913, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17911, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void flying_rc_track_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_right_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_left_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_left_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void flying_rc_track_right_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + flying_rc_track_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_flying_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return flying_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return flying_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return flying_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return flying_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return flying_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return flying_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return flying_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return flying_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return flying_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return flying_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return flying_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return flying_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return flying_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return flying_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return flying_rc_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return flying_rc_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return flying_rc_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return flying_rc_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return flying_rc_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return flying_rc_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return flying_rc_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return flying_rc_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return flying_rc_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return flying_rc_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return flying_rc_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return flying_rc_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return flying_rc_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return flying_rc_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return flying_rc_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return flying_rc_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return flying_rc_track_right_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: + return flying_rc_track_left_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: + return flying_rc_track_right_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return flying_rc_track_left_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return flying_rc_track_right_quarter_turn_5_25_deg_down; + case TRACK_ELEM_S_BEND_LEFT: + return flying_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return flying_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return flying_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return flying_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return flying_rc_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return flying_rc_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return flying_rc_track_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return flying_rc_track_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return flying_rc_track_left_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return flying_rc_track_right_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: + return flying_rc_track_left_half_banked_helix_up_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: + return flying_rc_track_right_half_banked_helix_up_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: + return flying_rc_track_left_half_banked_helix_down_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: + return flying_rc_track_right_half_banked_helix_down_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: + return flying_rc_track_left_half_banked_helix_up_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: + return flying_rc_track_right_half_banked_helix_up_large; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: + return flying_rc_track_left_half_banked_helix_down_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: + return flying_rc_track_right_half_banked_helix_down_large; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP: + return flying_rc_track_left_quarter_turn_1_60_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP: + return flying_rc_track_right_quarter_turn_1_60_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return flying_rc_track_left_quarter_turn_1_60_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return flying_rc_track_right_quarter_turn_1_60_deg_down; + case TRACK_ELEM_BRAKES: + return flying_rc_track_brakes; + case TRACK_ELEM_LEFT_QUARTER_BANKED_HELIX_LARGE_UP: + return flying_rc_track_left_quarter_banked_helix_large_up; + case TRACK_ELEM_RIGHT_QUARTER_BANKED_HELIX_LARGE_UP: + return flying_rc_track_right_quarter_banked_helix_large_up; + case TRACK_ELEM_LEFT_QUARTER_BANKED_HELIX_LARGE_DOWN: + return flying_rc_track_left_quarter_banked_helix_large_down; + case TRACK_ELEM_RIGHT_QUARTER_BANKED_HELIX_LARGE_DOWN: + return flying_rc_track_right_quarter_banked_helix_large_down; + case TRACK_ELEM_25_DEG_UP_LEFT_BANKED: + return flying_rc_track_25_deg_up_left_banked; + case TRACK_ELEM_25_DEG_UP_RIGHT_BANKED: + return flying_rc_track_25_deg_up_right_banked; + case TRACK_ELEM_ON_RIDE_PHOTO: + return flying_rc_track_on_ride_photo; + case TRACK_ELEM_25_DEG_DOWN_LEFT_BANKED: + return flying_rc_track_25_deg_down_left_banked; + case TRACK_ELEM_25_DEG_DOWN_RIGHT_BANKED: + return flying_rc_track_25_deg_down_right_banked; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return flying_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return flying_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return flying_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return flying_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + return flying_rc_track_left_eighth_bank_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + return flying_rc_track_right_eighth_bank_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + return flying_rc_track_left_eighth_bank_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + return flying_rc_track_right_eighth_bank_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return flying_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return flying_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP: + return flying_rc_track_diag_60_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return flying_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + return flying_rc_track_diag_25_deg_up_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + return flying_rc_track_diag_60_deg_up_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return flying_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return flying_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN: + return flying_rc_track_diag_60_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return flying_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + return flying_rc_track_diag_25_deg_down_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + return flying_rc_track_diag_60_deg_down_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return flying_rc_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + return flying_rc_track_diag_flat_to_left_bank; + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + return flying_rc_track_diag_flat_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + return flying_rc_track_diag_left_bank_to_flat; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + return flying_rc_track_diag_right_bank_to_flat; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + return flying_rc_track_diag_left_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + return flying_rc_track_diag_right_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + return flying_rc_track_diag_25_deg_up_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + return flying_rc_track_diag_25_deg_up_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + return flying_rc_track_diag_left_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + return flying_rc_track_diag_right_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + return flying_rc_track_diag_25_deg_down_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + return flying_rc_track_diag_25_deg_down_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK: + return flying_rc_track_diag_left_bank; + case TRACK_ELEM_DIAG_RIGHT_BANK: + return flying_rc_track_diag_right_bank; + case TRACK_ELEM_LEFT_FLYER_TWIST_UP: + return flying_rc_track_left_flyer_twist_up; + case TRACK_ELEM_RIGHT_FLYER_TWIST_UP: + return flying_rc_track_right_flyer_twist_up; + case TRACK_ELEM_LEFT_FLYER_TWIST_DOWN: + return flying_rc_track_left_flyer_twist_down; + case TRACK_ELEM_RIGHT_FLYER_TWIST_DOWN: + return flying_rc_track_right_flyer_twist_down; + case TRACK_ELEM_FLYER_HALF_LOOP_UP: + return flying_rc_track_flyer_half_loop_up; + case TRACK_ELEM_FLYER_HALF_LOOP_DOWN: + return flying_rc_track_flyer_half_loop_down; + case TRACK_ELEM_BLOCK_BRAKES: + return flying_rc_track_block_brakes; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return flying_rc_track_left_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return flying_rc_track_right_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return flying_rc_track_left_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return flying_rc_track_right_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return flying_rc_track_left_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return flying_rc_track_right_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return flying_rc_track_left_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return flying_rc_track_right_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANKED_25_DEG_UP: + return flying_rc_track_25_deg_up_to_left_banked_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANKED_25_DEG_UP: + return flying_rc_track_25_deg_up_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return flying_rc_track_left_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return flying_rc_track_right_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANKED_25_DEG_DOWN: + return flying_rc_track_25_deg_down_to_left_banked_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANKED_25_DEG_DOWN: + return flying_rc_track_25_deg_down_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return flying_rc_track_left_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return flying_rc_track_right_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return flying_rc_track_left_banked_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return flying_rc_track_right_banked_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_LEFT_BANKED_FLAT: + return flying_rc_track_left_banked_25_deg_up_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_RIGHT_BANKED_FLAT: + return flying_rc_track_right_banked_25_deg_up_to_right_banked_flat; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return flying_rc_track_left_banked_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return flying_rc_track_right_banked_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_LEFT_BANKED_FLAT: + return flying_rc_track_left_banked_25_deg_down_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_RIGHT_BANKED_FLAT: + return flying_rc_track_right_banked_25_deg_down_to_right_banked_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return flying_rc_track_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return flying_rc_track_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_FLAT: + return flying_rc_track_left_banked_25_deg_up_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_FLAT: + return flying_rc_track_right_banked_25_deg_up_to_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return flying_rc_track_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return flying_rc_track_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_FLAT: + return flying_rc_track_left_banked_25_deg_down_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_FLAT: + return flying_rc_track_right_banked_25_deg_down_to_flat; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 36d97c95cb..c97560b772 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6298,7 +6298,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_wild_mouse, // RIDE_TYPE_WILD_MOUSE get_track_paint_function_multi_dimension_rc, // RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER 0, // RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER_ALT - 0, // RIDE_TYPE_FLYING_ROLLER_COASTER + get_track_paint_function_flying_rc, // RIDE_TYPE_FLYING_ROLLER_COASTER 0, // RIDE_TYPE_FLYING_ROLLER_COASTER_ALT get_track_paint_function_virginia_reel, // RIDE_TYPE_VIRGINIA_REEL get_track_paint_function_splash_boats, // RIDE_TYPE_SPLASH_BOATS diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index f38613613d..86c57070fc 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -306,6 +306,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_twister_rc(int trackType, int dire TRACK_PAINT_FUNCTION get_track_paint_function_side_friction_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_wild_mouse(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_multi_dimension_rc(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_flying_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_virginia_reel(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_splash_boats(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_mini_helicopters(int trackType, int direction); From 3e5d445b79a4976eaea0bce7d93e72ed3a6f9ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:43:49 +0200 Subject: [PATCH 17/55] Add generated Lay down RC --- src/ride/coaster/lay_down_roller_coaster.c | 6274 ++++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 6276 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/lay_down_roller_coaster.c b/src/ride/coaster/lay_down_roller_coaster.c index 846fd9695d..ee4c23d4e5 100644 --- a/src/ride/coaster/lay_down_roller_coaster.c +++ b/src/ride/coaster/lay_down_roller_coaster.c @@ -13,3 +13,6277 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void lay_down_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16226, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16227, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16228, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16229, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16224, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16225, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void lay_down_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16314, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16315, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16316, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16317, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16286, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16287, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16288, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16289, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void lay_down_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16330, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16331, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16332, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16333, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16302, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16303, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16304, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16305, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void lay_down_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16306, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16307, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16308, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16309, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16278, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16279, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16280, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16281, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void lay_down_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16318, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16319, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16322, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16320, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16323, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16321, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16290, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16291, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16294, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16292, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16295, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16293, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void lay_down_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16324, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16325, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16328, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16326, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16329, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16327, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16296, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16297, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16300, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16298, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16301, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16299, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void lay_down_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16310, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16311, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16312, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16313, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16282, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16283, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16284, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16285, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void lay_down_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lay_down_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lay_down_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lay_down_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lay_down_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lay_down_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lay_down_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lay_down_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lay_down_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lay_down_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lay_down_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lay_down_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lay_down_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16343, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16348, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16353, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16338, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16342, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16347, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16352, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16337, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16341, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16346, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16351, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16336, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16340, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16345, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16350, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16335, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16339, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16344, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16349, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16334, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + lay_down_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lay_down_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16238, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16246, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16239, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16247, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16240, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16241, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void lay_down_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16242, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16243, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16244, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16248, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16245, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16249, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void lay_down_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16244, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16248, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16245, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16249, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16242, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16243, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void lay_down_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16240, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16241, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16238, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16246, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16239, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16247, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void lay_down_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16363, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16374, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16368, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16373, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16358, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16362, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16367, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16372, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16357, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16361, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16366, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16371, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16356, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16360, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16365, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16370, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16355, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16359, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16364, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16369, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16375, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16354, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + lay_down_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lay_down_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16250, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16254, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16251, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16255, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16252, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16253, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void lay_down_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16256, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16257, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16258, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16260, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16259, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16261, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void lay_down_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16262, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16266, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16263, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16267, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16264, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16265, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void lay_down_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16268, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16269, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16270, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16272, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16271, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16273, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void lay_down_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lay_down_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lay_down_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lay_down_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lay_down_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lay_down_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lay_down_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lay_down_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lay_down_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16274, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16275, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16276, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16277, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void lay_down_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lay_down_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lay_down_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16510, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16515, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16520, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16525, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16511, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16516, 0, 0, 32, 16, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16521, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16526, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16512, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16517, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16522, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16527, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16513, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16518, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16523, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16528, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16514, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16519, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16524, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16529, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lay_down_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16490, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16495, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16500, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16505, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16491, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16496, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16501, 0, 0, 32, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16506, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16492, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16497, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16502, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16507, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16493, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16498, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16503, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16508, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16494, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16499, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16504, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16509, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lay_down_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + lay_down_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void lay_down_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + lay_down_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lay_down_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16402, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16406, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16405, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16409, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16403, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16407, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16404, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16408, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16404, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16408, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16403, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16407, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16405, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16409, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16402, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16406, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16410, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16414, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16413, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16417, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16411, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(11, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16415, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(11, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16412, 0, 0, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16416, 0, 0, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16412, 0, 0, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16416, 0, 0, 32, 26, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16411, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(11, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16415, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(11, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16413, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16417, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16410, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16414, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_left_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16562, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16570, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16569, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16577, 0, 6, 32, 20, 7, height); + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16563, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16571, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(11, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16568, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16576, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16564, 16, 0, 3, 16, 119, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16572, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16567, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16575, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16565, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16573, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16566, 0, 16, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16574, 0, 16, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16566, 0, 16, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16574, 0, 16, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16565, 0, 0, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16573, 0, 0, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16567, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16575, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16564, 16, 0, 3, 16, 119, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16572, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16568, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16576, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16563, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16571, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(11, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16569, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16577, 0, 6, 32, 20, 7, height); + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16562, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16570, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lay_down_rc_track_right_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16593, 0, 6, 32, 20, 7, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16585, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16586, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16578, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16592, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16584, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16587, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(11, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16579, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16591, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16583, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16588, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16580, 16, 0, 2, 16, 119, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16590, 0, 16, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16582, 0, 16, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16589, 0, 0, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16581, 0, 0, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16589, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16581, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16590, 0, 16, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16582, 0, 16, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16588, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16580, 16, 0, 2, 16, 119, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16591, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16583, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16587, 0, 14, 32, 2, 63, height); + metal_a_supports_paint_setup(11, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16579, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16592, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16584, 0, 6, 32, 26, 3, height); + metal_a_supports_paint_setup(11, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16586, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16578, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16593, 0, 6, 32, 20, 7, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16585, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lay_down_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16381, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16384, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16387, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16378, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16380, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16383, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16386, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16377, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16379, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16382, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16385, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16376, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + lay_down_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lay_down_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16393, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16400, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16396, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16399, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16390, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16392, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16395, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16398, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16389, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16391, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16394, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16397, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16401, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16388, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + lay_down_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lay_down_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16541, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16543, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16545, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16539, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16540, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16542, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16544, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16538, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lay_down_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16530, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16532, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16534, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16536, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16531, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16533, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16535, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(11, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16537, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lay_down_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + lay_down_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void lay_down_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + lay_down_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lay_down_rc_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16481, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16488, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16484, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16487, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16478, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16480, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16483, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16486, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16477, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16479, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16482, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16485, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16489, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16476, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16478, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16481, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16488, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16484, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16487, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16477, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16480, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16483, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16486, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16476, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16479, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16482, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16485, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16489, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16462, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16465, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16468, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16471, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16475, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16463, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16466, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16469, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16472, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16464, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16467, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16474, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16470, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16473, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16465, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16468, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16471, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16475, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16462, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16466, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16469, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16472, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16463, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16467, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16474, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16470, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16473, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16464, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + lay_down_rc_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void lay_down_rc_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + lay_down_rc_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lay_down_rc_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16449, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16460, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16454, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16459, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16444, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16448, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16453, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16458, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16443, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16447, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16452, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16457, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16442, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16446, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16451, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16456, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16441, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16445, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16450, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16455, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16461, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16440, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16444, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16449, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16460, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16454, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16459, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16443, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16448, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16453, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16458, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16442, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16447, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16452, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16457, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16441, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16446, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16451, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16456, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16440, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16445, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16450, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16455, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16461, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16418, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16423, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16428, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16433, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16439, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16419, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16424, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16429, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16434, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16420, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16425, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16430, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16435, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16421, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16426, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16431, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16436, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16422, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16427, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16438, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16432, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16437, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16423, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16428, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16433, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16439, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16418, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(11, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16424, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16429, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16434, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16419, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16425, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16430, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16435, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16420, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16426, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16431, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16436, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16421, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16427, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16438, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16432, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16437, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16422, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + lay_down_rc_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void lay_down_rc_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + lay_down_rc_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lay_down_rc_track_left_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16555, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16559, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16556, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16560, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16557, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16561, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16554, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16558, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_left(height - 8, TUNNEL_2); + break; + case 2: + paint_util_push_tunnel_right(height + 56, TUNNEL_1); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + paint_util_push_tunnel_left(height + 56, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void lay_down_rc_track_right_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16546, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16550, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16547, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16551, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16548, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16552, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16549, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16553, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 56, TUNNEL_1); + paint_util_push_tunnel_left(height - 8, TUNNEL_1); + break; + case 1: + paint_util_push_tunnel_left(height + 56, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void lay_down_rc_track_left_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lay_down_rc_track_right_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void lay_down_rc_track_right_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lay_down_rc_track_left_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lay_down_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16230, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16231, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void lay_down_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + 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] | 16224, 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] | 16225, 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] | 16224, 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] | 16225, 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); + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void lay_down_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16740, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16744, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16748, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16752, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16741, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16745, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16749, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16753, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16742, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16746, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16750, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16754, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16743, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16747, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16751, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16755, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16724, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16728, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16732, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16736, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16725, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16729, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16733, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16737, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16726, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16730, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16734, 0, 0, 28, 28, 3, height, 4, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16738, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16727, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16731, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16735, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16739, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + lay_down_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lay_down_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + lay_down_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void lay_down_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16772, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16776, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16780, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16784, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16773, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16777, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16781, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16785, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16774, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16778, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16782, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16786, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16775, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16779, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16783, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16787, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16756, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16760, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16764, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16768, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16757, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16761, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16765, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16769, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16758, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16762, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16766, 0, 0, 28, 28, 0, height, 4, 4, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16770, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16759, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16763, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16767, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16771, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + lay_down_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lay_down_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + lay_down_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void lay_down_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16699, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16637, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16696, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16634, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16698, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16636, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16697, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16635, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16711, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16649, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16708, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16646, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16710, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16648, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16709, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16647, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16723, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16661, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16720, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16658, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16722, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16660, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16721, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16659, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16703, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16641, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16700, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16638, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16702, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16640, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16701, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16639, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16715, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16653, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16712, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16650, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16714, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16652, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16713, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16651, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16719, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16657, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16716, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16654, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16718, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16656, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16717, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(11, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16655, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(11, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16707, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16645, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16704, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16642, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16706, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16644, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16705, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16643, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16709, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16647, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16710, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16648, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16708, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16646, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16711, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16649, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16721, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16659, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16722, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16660, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16720, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16658, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16723, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16661, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16705, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16643, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16706, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16644, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16704, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16642, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16707, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16645, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16717, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16655, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16718, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16656, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16716, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16654, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16719, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16657, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16713, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16651, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16714, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16652, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16712, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16650, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16715, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16653, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16701, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16639, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16702, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16640, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16700, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16638, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16703, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16641, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16669, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16666, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16670, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16668, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16667, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16674, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16671, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16673, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16675, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16672, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16672, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16673, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16675, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16671, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16674, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16667, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16668, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16666, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16670, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16669, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16689, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16686, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16690, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16688, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16687, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16694, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16691, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16693, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16695, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16692, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16679, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16676, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16680, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16678, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16677, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16684, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16681, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16683, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16685, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16682, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16682, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16683, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16685, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16681, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16684, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16677, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16678, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16676, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16680, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16679, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16692, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16693, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16695, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16691, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16694, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16687, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16688, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16686, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16690, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16689, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16665, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16662, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16664, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16663, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16663, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16664, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16662, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16665, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(11, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_left_flyer_twist_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26972, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26978, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26971, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26977, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26973, 0, 6, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26979, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26970, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26976, 0, 6, 32, 20, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26974, 0, 6, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26980, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26969, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26975, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 33, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_right_flyer_twist_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26984, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26990, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26983, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26989, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26985, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26991, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26982, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26988, 0, 6, 32, 20, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26986, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26992, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26981, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26987, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 33, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_left_flyer_twist_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26969, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26975, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26974, 0, 6, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26980, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 33, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26970, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26976, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26973, 0, 6, 32, 20, 3, height + 24, 0, 6, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26979, 0, 6, 32, 20, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26971, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26977, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26972, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26978, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_right_flyer_twist_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26981, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26987, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26986, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26992, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 33, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26982, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26988, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26985, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26991, 0, 6, 32, 20, 3, height + 24); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26983, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26989, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26984, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26990, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lay_down_rc_track_flyer_half_loop_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16594, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16602, 0, 6, 32, 20, 11, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16601, 0, 6, 32, 20, 9, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16609, 0, 6, 32, 20, 7, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16595, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(11, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16603, 0, 14, 3, 20, 63, height, 28, 6, height); + metal_a_supports_paint_setup(11, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16600, 0, 6, 3, 20, 63, height, 28, 6, height); + metal_a_supports_paint_setup(11, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16608, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(11, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16596, 16, 0, 2, 16, 119, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16604, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16599, 10, 16, 4, 12, 119, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16607, 16, 16, 2, 16, 119, height, 15, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16597, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16605, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16598, 0, 16, 32, 12, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16606, 0, 16, 32, 12, 3, height + 32); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lay_down_rc_track_flyer_half_loop_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16597, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16605, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16598, 0, 16, 32, 12, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16606, 0, 16, 32, 12, 3, height + 32); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16596, 16, 0, 2, 16, 119, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16604, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16599, 10, 16, 4, 12, 119, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16607, 16, 16, 2, 16, 119, height, 15, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16595, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(11, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16603, 0, 14, 3, 20, 63, height, 28, 6, height); + metal_a_supports_paint_setup(11, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16600, 0, 6, 3, 20, 63, height, 28, 6, height); + metal_a_supports_paint_setup(11, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16608, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(11, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16594, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16602, 0, 6, 32, 20, 11, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16601, 0, 6, 32, 20, 9, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16609, 0, 6, 32, 20, 7, height); + break; + } + metal_a_supports_paint_setup(11, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lay_down_rc_track_left_flyer_corkscrew_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16610, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16613, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16616, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16619, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16611, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16614, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16617, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16620, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16612, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16615, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16618, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16621, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 35, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lay_down_rc_track_right_flyer_corkscrew_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16622, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16625, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16628, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16631, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16623, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16626, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16629, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16632, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16624, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16627, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16630, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16633, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 35, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lay_down_rc_track_left_flyer_corkscrew_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16627, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16630, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16633, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16624, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 35, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16626, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16629, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16632, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16623, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16625, 0, 0, 20, 32, 3, height, 6, 0, height + 4); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16628, 0, 0, 20, 32, 3, height, 6, 0, height + 4); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16631, 0, 0, 20, 32, 3, height, 6, 0, height + 4); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16622, 0, 0, 20, 32, 3, height, 6, 0, height + 4); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lay_down_rc_track_right_flyer_corkscrew_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16621, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16612, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16615, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16618, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 35, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16620, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16611, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16614, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16617, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16619, 0, 0, 20, 32, 3, height, 6, 0, height + 4); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16610, 0, 0, 20, 32, 3, height, 6, 0, height + 4); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16613, 0, 0, 20, 32, 3, height, 6, 0, height + 4); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16616, 0, 0, 20, 32, 3, height, 6, 0, height + 4); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lay_down_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16232, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16233, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_lay_down_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return lay_down_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return lay_down_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return lay_down_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return lay_down_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return lay_down_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return lay_down_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return lay_down_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return lay_down_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return lay_down_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return lay_down_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return lay_down_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return lay_down_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return lay_down_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return lay_down_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return lay_down_rc_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return lay_down_rc_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return lay_down_rc_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return lay_down_rc_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return lay_down_rc_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return lay_down_rc_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return lay_down_rc_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return lay_down_rc_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return lay_down_rc_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return lay_down_rc_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return lay_down_rc_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return lay_down_rc_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return lay_down_rc_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return lay_down_rc_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return lay_down_rc_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return lay_down_rc_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return lay_down_rc_track_right_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: + return lay_down_rc_track_left_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: + return lay_down_rc_track_right_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return lay_down_rc_track_left_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return lay_down_rc_track_right_quarter_turn_5_25_deg_down; + case TRACK_ELEM_S_BEND_LEFT: + return lay_down_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return lay_down_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_VERTICAL_LOOP: + return lay_down_rc_track_left_vertical_loop; + case TRACK_ELEM_RIGHT_VERTICAL_LOOP: + return lay_down_rc_track_right_vertical_loop; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return lay_down_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return lay_down_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return lay_down_rc_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return lay_down_rc_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return lay_down_rc_track_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return lay_down_rc_track_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return lay_down_rc_track_left_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return lay_down_rc_track_right_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: + return lay_down_rc_track_left_half_banked_helix_up_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: + return lay_down_rc_track_right_half_banked_helix_up_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: + return lay_down_rc_track_left_half_banked_helix_down_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: + return lay_down_rc_track_right_half_banked_helix_down_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: + return lay_down_rc_track_left_half_banked_helix_up_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: + return lay_down_rc_track_right_half_banked_helix_up_large; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: + return lay_down_rc_track_left_half_banked_helix_down_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: + return lay_down_rc_track_right_half_banked_helix_down_large; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP: + return lay_down_rc_track_left_quarter_turn_1_60_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP: + return lay_down_rc_track_right_quarter_turn_1_60_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return lay_down_rc_track_left_quarter_turn_1_60_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return lay_down_rc_track_right_quarter_turn_1_60_deg_down; + case TRACK_ELEM_BRAKES: + return lay_down_rc_track_brakes; + case TRACK_ELEM_ON_RIDE_PHOTO: + return lay_down_rc_track_on_ride_photo; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return lay_down_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return lay_down_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return lay_down_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return lay_down_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + return lay_down_rc_track_left_eighth_bank_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + return lay_down_rc_track_right_eighth_bank_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + return lay_down_rc_track_left_eighth_bank_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + return lay_down_rc_track_right_eighth_bank_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return lay_down_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return lay_down_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP: + return lay_down_rc_track_diag_60_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return lay_down_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + return lay_down_rc_track_diag_25_deg_up_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + return lay_down_rc_track_diag_60_deg_up_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return lay_down_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return lay_down_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN: + return lay_down_rc_track_diag_60_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return lay_down_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + return lay_down_rc_track_diag_25_deg_down_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + return lay_down_rc_track_diag_60_deg_down_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return lay_down_rc_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + return lay_down_rc_track_diag_flat_to_left_bank; + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + return lay_down_rc_track_diag_flat_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + return lay_down_rc_track_diag_left_bank_to_flat; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + return lay_down_rc_track_diag_right_bank_to_flat; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + return lay_down_rc_track_diag_left_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + return lay_down_rc_track_diag_right_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + return lay_down_rc_track_diag_25_deg_up_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + return lay_down_rc_track_diag_25_deg_up_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + return lay_down_rc_track_diag_left_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + return lay_down_rc_track_diag_right_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + return lay_down_rc_track_diag_25_deg_down_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + return lay_down_rc_track_diag_25_deg_down_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK: + return lay_down_rc_track_diag_left_bank; + case TRACK_ELEM_DIAG_RIGHT_BANK: + return lay_down_rc_track_diag_right_bank; + case TRACK_ELEM_LEFT_FLYER_TWIST_UP: + return lay_down_rc_track_left_flyer_twist_up; + case TRACK_ELEM_RIGHT_FLYER_TWIST_UP: + return lay_down_rc_track_right_flyer_twist_up; + case TRACK_ELEM_LEFT_FLYER_TWIST_DOWN: + return lay_down_rc_track_left_flyer_twist_down; + case TRACK_ELEM_RIGHT_FLYER_TWIST_DOWN: + return lay_down_rc_track_right_flyer_twist_down; + case TRACK_ELEM_FLYER_HALF_LOOP_UP: + return lay_down_rc_track_flyer_half_loop_up; + case TRACK_ELEM_FLYER_HALF_LOOP_DOWN: + return lay_down_rc_track_flyer_half_loop_down; + case TRACK_ELEM_LEFT_FLYER_CORKSCREW_UP: + return lay_down_rc_track_left_flyer_corkscrew_up; + case TRACK_ELEM_RIGHT_FLYER_CORKSCREW_UP: + return lay_down_rc_track_right_flyer_corkscrew_up; + case TRACK_ELEM_LEFT_FLYER_CORKSCREW_DOWN: + return lay_down_rc_track_left_flyer_corkscrew_down; + case TRACK_ELEM_RIGHT_FLYER_CORKSCREW_DOWN: + return lay_down_rc_track_right_flyer_corkscrew_down; + case TRACK_ELEM_BLOCK_BRAKES: + return lay_down_rc_track_block_brakes; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index c97560b772..d5e70ddd53 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6303,7 +6303,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_virginia_reel, // RIDE_TYPE_VIRGINIA_REEL get_track_paint_function_splash_boats, // RIDE_TYPE_SPLASH_BOATS get_track_paint_function_mini_helicopters, // RIDE_TYPE_MINI_HELICOPTERS - 0, // RIDE_TYPE_LAY_DOWN_ROLLER_COASTER + get_track_paint_function_lay_down_rc, // RIDE_TYPE_LAY_DOWN_ROLLER_COASTER 0, // RIDE_TYPE_SUSPENDED_MONORAIL 0, // RIDE_TYPE_LAY_DOWN_ROLLER_COASTER_ALT 0, // RIDE_TYPE_REVERSER_ROLLER_COASTER diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 86c57070fc..dbbd9ea871 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -310,6 +310,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_flying_rc(int trackType, int direc TRACK_PAINT_FUNCTION get_track_paint_function_virginia_reel(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_splash_boats(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_mini_helicopters(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_lay_down_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_mini_golf(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_roto_drop(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_flying_saucers(int trackType, int direction); From 1ce3c28eeeaa088417a0881f15895535bdb031ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:47:46 +0200 Subject: [PATCH 18/55] Add generated Suspended monorail --- src/paint/map_element/map_element.h | 3 +- src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + src/ride/transport/suspended_monorail.c | 1162 +++++++++++++++++++++++ 4 files changed, 1166 insertions(+), 2 deletions(-) diff --git a/src/paint/map_element/map_element.h b/src/paint/map_element/map_element.h index d49d93ca6e..d1065c32ad 100644 --- a/src/paint/map_element/map_element.h +++ b/src/paint/map_element/map_element.h @@ -65,7 +65,8 @@ enum TUNNEL_11 = 0x0B, TUNNEL_12 = 0x0C, TUNNEL_13 = 0x0D, - TUNNEL_14 = 0x0E + TUNNEL_14 = 0x0E, + TUNNEL_15 = 0x0F, }; typedef struct tunnel_entry { diff --git a/src/ride/track_data.c b/src/ride/track_data.c index d5e70ddd53..3a2f143405 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6304,7 +6304,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_splash_boats, // RIDE_TYPE_SPLASH_BOATS get_track_paint_function_mini_helicopters, // RIDE_TYPE_MINI_HELICOPTERS get_track_paint_function_lay_down_rc, // RIDE_TYPE_LAY_DOWN_ROLLER_COASTER - 0, // RIDE_TYPE_SUSPENDED_MONORAIL + get_track_paint_function_suspended_monorail, // RIDE_TYPE_SUSPENDED_MONORAIL 0, // RIDE_TYPE_LAY_DOWN_ROLLER_COASTER_ALT 0, // RIDE_TYPE_REVERSER_ROLLER_COASTER 0, // RIDE_TYPE_HEARTLINE_TWISTER_COASTER diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index dbbd9ea871..45d51b4209 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -311,6 +311,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_virginia_reel(int trackType, int d TRACK_PAINT_FUNCTION get_track_paint_function_splash_boats(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_mini_helicopters(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_lay_down_rc(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_suspended_monorail(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_mini_golf(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_roto_drop(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_flying_saucers(int trackType, int direction); diff --git a/src/ride/transport/suspended_monorail.c b/src/ride/transport/suspended_monorail.c index 846fd9695d..6687382e15 100644 --- a/src/ride/transport/suspended_monorail.c +++ b/src/ride/transport/suspended_monorail.c @@ -13,3 +13,1165 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void suspended_monorail_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25853, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25854, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 4, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_9); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void suspended_monorail_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25945, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 48); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 60, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25946, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 48); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 60, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25947, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 48); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 60, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25948, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 48); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 60, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void suspended_monorail_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25937, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25938, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25939, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25940, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_9); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void suspended_monorail_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25941, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 6, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25942, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 8, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25943, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 7, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25944, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(3, 5, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_9); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_15); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void suspended_monorail_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + suspended_monorail_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void suspended_monorail_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + suspended_monorail_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void suspended_monorail_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + suspended_monorail_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void suspended_monorail_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25876, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25881, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25886, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25871, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_9); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25875, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25880, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25885, 0, 0, 32, 16, 3, height + 32, 0, 16, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25870, 0, 0, 32, 16, 3, height + 32, 0, 16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25874, 0, 0, 16, 16, 3, height + 32, 0, 16, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25879, 0, 0, 16, 16, 3, height + 32, 16, 16, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25884, 0, 0, 16, 16, 3, height + 32, 16, 0, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25869, 0, 0, 16, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25873, 0, 0, 16, 32, 3, height + 32, 16, 0, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25878, 0, 0, 16, 32, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25883, 0, 0, 16, 32, 3, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25868, 0, 0, 16, 32, 3, height + 32, 16, 0, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25872, 0, 0, 20, 32, 3, height + 32, 6, 0, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25877, 0, 0, 20, 32, 3, height + 32, 6, 0, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25882, 0, 0, 20, 32, 3, height + 32, 6, 0, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25867, 0, 0, 20, 32, 3, height + 32, 6, 0, height + 32); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_9); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_9); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_monorail_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + suspended_monorail_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void suspended_monorail_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25919, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25923, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25922, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25926, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_9); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25920, 0, 0, 32, 26, 3, height + 32); + metal_a_supports_paint_setup(3, 5, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25924, 0, 0, 32, 26, 3, height + 32); + metal_a_supports_paint_setup(3, 6, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25921, 0, 0, 32, 26, 3, height + 32, 0, 6, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25925, 0, 0, 32, 26, 3, height + 32, 0, 6, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25921, 0, 0, 32, 26, 3, height + 32, 0, 6, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25925, 0, 0, 32, 26, 3, height + 32, 0, 6, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25920, 0, 0, 32, 26, 3, height + 32); + metal_a_supports_paint_setup(3, 5, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25924, 0, 0, 32, 26, 3, height + 32); + metal_a_supports_paint_setup(3, 6, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25922, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25926, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25919, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25923, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_9); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_9); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_monorail_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25927, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25931, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25930, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25934, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_9); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25928, 0, 0, 32, 26, 3, height + 32, 0, 6, height + 32); + metal_a_supports_paint_setup(3, 8, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25932, 0, 0, 32, 26, 3, height + 32, 0, 6, height + 32); + metal_a_supports_paint_setup(3, 7, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25929, 0, 0, 32, 26, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25933, 0, 0, 32, 26, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25929, 0, 0, 32, 26, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25933, 0, 0, 32, 26, 3, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25928, 0, 0, 32, 26, 3, height + 32, 0, 6, height + 32); + metal_a_supports_paint_setup(3, 8, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25932, 0, 0, 32, 26, 3, height + 32, 0, 6, height + 32); + metal_a_supports_paint_setup(3, 7, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25930, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25934, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25927, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25931, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_9); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_9); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_monorail_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25860, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25863, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25866, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25857, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_9); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25859, 0, 0, 16, 16, 3, height + 32, 16, 0, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25862, 0, 0, 16, 16, 3, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25865, 0, 0, 16, 16, 3, height + 32, 0, 16, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25856, 0, 0, 16, 16, 3, height + 32, 16, 16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25858, 0, 0, 20, 32, 3, height + 32, 6, 0, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25861, 0, 0, 20, 32, 3, height + 32, 6, 0, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25864, 0, 0, 20, 32, 3, height + 32, 6, 0, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25855, 0, 0, 20, 32, 3, height + 32, 6, 0, height + 32); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_9); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_9); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_monorail_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + suspended_monorail_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void suspended_monorail_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25903, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25907, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25911, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25915, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_9); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25904, 0, 0, 32, 16, 3, height + 32, 0, 0, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25908, 0, 0, 34, 16, 3, height + 32, 0, 0, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25912, 0, 0, 32, 16, 3, height + 32, 0, 16, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25916, 0, 0, 32, 16, 3, height + 32, 0, 16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25905, 0, 0, 16, 16, 3, height + 32, 0, 16, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25909, 0, 0, 16, 16, 3, height + 32, 16, 16, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25913, 0, 0, 16, 16, 3, height + 32, 16, 0, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25917, 0, 0, 16, 16, 3, height + 32, 0, 0, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25906, 0, 0, 16, 16, 3, height + 32, 16, 16, height + 32); + metal_a_supports_paint_setup(3, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25910, 0, 0, 16, 18, 3, height + 32, 0, 16, height + 32); + metal_a_supports_paint_setup(3, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25914, 0, 0, 16, 16, 3, height + 32, 0, 0, height + 32); + metal_a_supports_paint_setup(3, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25918, 0, 0, 16, 16, 3, height + 32, 16, 0, height + 32); + metal_a_supports_paint_setup(3, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_monorail_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25887, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25891, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25895, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25899, 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + break; + } + metal_a_supports_paint_setup(3, 4, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_9); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25888, 0, 0, 32, 16, 3, height + 32, 0, 16, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25892, 0, 0, 32, 16, 3, height + 32, 0, 16, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25896, 0, 0, 34, 16, 3, height + 32, 0, 0, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25900, 0, 0, 32, 16, 3, height + 32, 0, 0, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25889, 0, 0, 16, 16, 3, height + 32, 0, 0, height + 32); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25893, 0, 0, 16, 16, 3, height + 32, 16, 0, height + 32); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25897, 0, 0, 28, 28, 3, height + 32, 4, 4, height + 32); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25901, 0, 0, 16, 16, 3, height + 32, 0, 16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25890, 0, 0, 16, 16, 3, height + 32, 16, 0, height + 32); + metal_a_supports_paint_setup(3, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25894, 0, 0, 16, 16, 3, height + 32, 0, 0, height + 32); + metal_a_supports_paint_setup(3, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25898, 0, 0, 16, 18, 3, height + 32, 0, 16, height + 32); + metal_a_supports_paint_setup(3, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25902, 0, 0, 16, 16, 3, height + 32, 16, 16, height + 32); + metal_a_supports_paint_setup(3, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_monorail_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + suspended_monorail_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void suspended_monorail_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + suspended_monorail_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void suspended_monorail_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25936, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25935, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25935, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25936, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 32); + metal_a_supports_paint_setup(3, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void suspended_monorail_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25960, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 48); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25957, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 48); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25959, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 48); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25958, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 48); + metal_a_supports_paint_setup(3, 0, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 55, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 57, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void suspended_monorail_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25952, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 40); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25949, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 40); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25951, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 40); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25950, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 40); + metal_a_supports_paint_setup(3, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void suspended_monorail_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25956, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 40); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25953, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 40); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25955, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 40); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 51, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25954, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 40); + metal_a_supports_paint_setup(3, 0, 0, height + 51, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 51, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 51, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void suspended_monorail_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25958, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 48); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25959, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 48); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25957, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 48); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25960, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 48); + metal_a_supports_paint_setup(3, 0, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 51, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 58, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void suspended_monorail_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25954, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 40); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25955, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 40); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25953, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 40); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25956, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 40); + metal_a_supports_paint_setup(3, 0, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void suspended_monorail_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25950, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 40); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25951, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 40); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25949, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 40); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(3, 1, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25952, -16, -16, 32, 32, 3, height + 32, -16, -16, height + 40); + metal_a_supports_paint_setup(3, 0, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(3, 2, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(3, 3, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +TRACK_PAINT_FUNCTION get_track_paint_function_suspended_monorail(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return suspended_monorail_track_flat; + case TRACK_ELEM_25_DEG_UP: + return suspended_monorail_track_25_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return suspended_monorail_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return suspended_monorail_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return suspended_monorail_track_25_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return suspended_monorail_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return suspended_monorail_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return suspended_monorail_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return suspended_monorail_track_right_quarter_turn_5; + case TRACK_ELEM_S_BEND_LEFT: + return suspended_monorail_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return suspended_monorail_track_s_bend_right; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return suspended_monorail_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return suspended_monorail_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return suspended_monorail_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return suspended_monorail_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return suspended_monorail_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return suspended_monorail_track_right_eighth_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return suspended_monorail_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return suspended_monorail_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return suspended_monorail_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return suspended_monorail_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return suspended_monorail_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return suspended_monorail_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return suspended_monorail_track_diag_25_deg_down_to_flat; + } + return NULL; +} From c8ae40332c56aa1bcbd5707d5327969409580c6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:55:48 +0200 Subject: [PATCH 19/55] Add generated Reverser RC Includes previous function `vehicle_visual_reverser` --- src/ride/coaster/reverser_roller_coaster.c | 1005 +++++++++++++++++++- src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 1005 insertions(+), 3 deletions(-) diff --git a/src/ride/coaster/reverser_roller_coaster.c b/src/ride/coaster/reverser_roller_coaster.c index de7fec0ed1..251697f025 100644 --- a/src/ride/coaster/reverser_roller_coaster.c +++ b/src/ride/coaster/reverser_roller_coaster.c @@ -14,10 +14,17 @@ *****************************************************************************/ #pragma endregion -#include "../../config.h" +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" #include "../../interface/viewport.h" -#include "../../world/sprite.h" +#include "../../paint/map_element/map_element.h" #include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" #include "../vehicle_paint.h" #ifndef NO_VEHICLES @@ -37,3 +44,997 @@ void vehicle_visual_reverser(int x, int imageDirection, int y, int z, rct_vehicl vehicle_visual_default(x, imageDirection, y, z, vehicle, vehicleEntry); } #endif + +static void reverser_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21520, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21521, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21504, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21505, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + 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 reverser_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21530, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 9, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21531, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 10, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21532, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 11, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21533, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 12, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21516, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 9, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21517, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 10, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21518, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 11, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21519, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 12, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void reverser_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21522, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 1, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21523, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 2, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21524, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 3, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21525, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 4, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21508, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 1, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21509, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 2, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21510, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 3, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21511, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 4, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void reverser_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21526, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 5, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21527, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 6, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21528, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 7, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21529, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 8, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21512, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 5, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21513, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 6, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21514, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 7, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21515, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 8, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void reverser_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + reverser_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void reverser_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + reverser_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void reverser_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + reverser_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void reverser_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21543, 0, 2, 32, 27, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21548, 0, 2, 32, 27, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21553, 0, 2, 32, 32, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21538, 0, 2, 32, 32, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21542, 0, 0, 32, 16, 2, height); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21547, 0, 0, 32, 16, 2, height); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21552, 0, 16, 32, 16, 2, height); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21537, 0, 16, 32, 16, 2, height); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21541, 0, 16, 16, 16, 2, height); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21546, 16, 16, 16, 16, 2, height); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21551, 16, 0, 16, 16, 2, height); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21536, 0, 0, 16, 16, 2, height); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21540, 16, 0, 16, 34, 2, height); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21545, 0, 0, 16, 32, 2, height); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21550, 0, 0, 16, 32, 2, height); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21535, 16, 0, 16, 32, 2, height); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21539, 2, 0, 32, 32, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21544, 2, 0, 27, 32, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21549, 2, 0, 27, 32, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21534, 2, 0, 32, 32, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void reverser_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + reverser_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void reverser_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21566, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21570, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21569, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21573, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21567, 0, 0, 32, 26, 2, height, 0, 0, height); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21571, 0, 0, 32, 26, 2, height, 0, 0, height); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21568, 0, 0, 32, 26, 2, height, 0, 6, height); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21572, 0, 0, 32, 26, 2, height, 0, 6, height); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21568, 0, 0, 32, 26, 2, height, 0, 6, height); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21572, 0, 0, 32, 26, 2, height, 0, 6, height); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21567, 0, 0, 32, 26, 2, height, 0, 0, height); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21571, 0, 0, 32, 26, 2, height, 0, 0, height); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21569, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21573, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21566, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21570, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void reverser_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21574, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21578, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21577, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21581, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21575, 0, 0, 32, 26, 2, height, 0, 6, height); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21579, 0, 0, 32, 26, 2, height, 0, 6, height); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21576, 0, 0, 32, 26, 2, height, 0, 0, height); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21580, 0, 0, 32, 26, 2, height, 0, 0, height); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21576, 0, 0, 32, 26, 2, height, 0, 0, height); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21580, 0, 0, 32, 26, 2, height, 0, 0, height); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21575, 0, 0, 32, 26, 2, height, 0, 6, height); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21579, 0, 0, 32, 26, 2, height, 0, 6, height); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21577, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21581, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21574, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21578, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void reverser_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21559, 0, 0, 32, 20, 2, height, 0, 6, height); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21562, 0, 0, 32, 20, 2, height, 0, 6, height); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21565, 0, 0, 32, 20, 2, height, 0, 6, height); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21556, 0, 0, 32, 20, 2, height, 0, 6, height); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21558, 0, 0, 16, 16, 2, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21561, 0, 0, 16, 16, 2, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21564, 0, 0, 16, 16, 2, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21555, 0, 0, 16, 16, 2, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21557, 0, 0, 20, 32, 2, height, 6, 0, height); + wooden_a_supports_paint_setup(5, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21560, 0, 0, 20, 32, 2, height, 6, 0, height); + wooden_a_supports_paint_setup(2, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21563, 0, 0, 20, 32, 2, height, 6, 0, height); + wooden_a_supports_paint_setup(3, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21554, 0, 0, 20, 32, 2, height, 6, 0, height); + wooden_a_supports_paint_setup(4, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void reverser_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + reverser_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void reverser_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21506, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21507, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + 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 reverser_rc_track_left_reverser(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21582, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21588, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21594, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21600, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21585, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21591, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21597, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21603, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21586, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21592, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21598, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21604, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21587, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21593, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21599, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21605, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21583, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21589, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21595, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21601, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21584, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21590, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21596, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21602, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void reverser_rc_track_right_reverser(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21596, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21602, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21584, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21590, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + 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); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21599, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21605, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21587, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21593, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21598, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21604, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21586, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21592, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21597, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21603, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21585, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21591, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21595, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21601, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21583, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21589, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21594, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21600, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21582, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(0, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21588, 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +TRACK_PAINT_FUNCTION get_track_paint_function_reverser_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return reverser_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return reverser_rc_track_25_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return reverser_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return reverser_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return reverser_rc_track_25_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return reverser_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return reverser_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return reverser_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return reverser_rc_track_right_quarter_turn_5; + case TRACK_ELEM_S_BEND_LEFT: + return reverser_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return reverser_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return reverser_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return reverser_rc_track_right_quarter_turn_3; + case TRACK_ELEM_BRAKES: + return reverser_rc_track_brakes; + case TRACK_ELEM_LEFT_REVERSER: + return reverser_rc_track_left_reverser; + case TRACK_ELEM_RIGHT_REVERSER: + return reverser_rc_track_right_reverser; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 3a2f143405..26f3ba9190 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6306,7 +6306,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_lay_down_rc, // RIDE_TYPE_LAY_DOWN_ROLLER_COASTER get_track_paint_function_suspended_monorail, // RIDE_TYPE_SUSPENDED_MONORAIL 0, // RIDE_TYPE_LAY_DOWN_ROLLER_COASTER_ALT - 0, // RIDE_TYPE_REVERSER_ROLLER_COASTER + get_track_paint_function_reverser_rc, // RIDE_TYPE_REVERSER_ROLLER_COASTER 0, // RIDE_TYPE_HEARTLINE_TWISTER_COASTER get_track_paint_function_mini_golf, // RIDE_TYPE_MINI_GOLF 0, // RIDE_TYPE_GIGA_COASTER diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 45d51b4209..6900870a43 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -312,6 +312,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_splash_boats(int trackType, int di TRACK_PAINT_FUNCTION get_track_paint_function_mini_helicopters(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_lay_down_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_suspended_monorail(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_reverser_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_mini_golf(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_roto_drop(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_flying_saucers(int trackType, int direction); From ec029877d11afb439e86c0acfdf1f131169342f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:57:48 +0200 Subject: [PATCH 20/55] Add generated Heartline twister coaster --- src/ride/coaster/heartline_twister_coaster.c | 1053 ++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 1055 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/heartline_twister_coaster.c b/src/ride/coaster/heartline_twister_coaster.c index 846fd9695d..47ee266a3f 100644 --- a/src/ride/coaster/heartline_twister_coaster.c +++ b/src/ride/coaster/heartline_twister_coaster.c @@ -13,3 +13,1056 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void heartline_twister_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21354, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21356, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21355, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21357, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21358, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21360, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21359, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21361, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21294, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21296, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21295, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21297, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void heartline_twister_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21378, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21382, 0, 0, 32, 1, 50, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 9, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21379, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21383, 0, 0, 32, 1, 50, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 10, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21380, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21384, 0, 0, 32, 1, 50, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 11, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21381, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21385, 0, 0, 32, 1, 50, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 12, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21322, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21326, 0, 0, 32, 1, 50, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 9, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21323, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21327, 0, 0, 32, 1, 50, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 10, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21324, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21328, 0, 0, 32, 1, 50, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 11, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21325, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21329, 0, 0, 32, 1, 50, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 12, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void heartline_twister_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21402, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21406, 0, 0, 32, 1, 98, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 21, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21403, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21407, 0, 0, 32, 1, 98, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 22, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21404, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21408, 0, 0, 32, 1, 98, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 23, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21405, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21409, 0, 0, 32, 1, 98, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 24, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21346, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21350, 0, 0, 32, 1, 98, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 21, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21347, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21351, 0, 0, 32, 1, 98, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 22, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21348, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21352, 0, 0, 32, 1, 98, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 23, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21349, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21353, 0, 0, 32, 1, 98, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 24, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_2); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void heartline_twister_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21362, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21366, 0, 0, 32, 1, 42, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 1, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21363, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21367, 0, 0, 32, 1, 42, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 2, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21364, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21368, 0, 0, 32, 1, 42, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 3, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21365, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21369, 0, 0, 32, 1, 42, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 4, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21306, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21310, 0, 0, 32, 1, 42, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 1, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21307, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21311, 0, 0, 32, 1, 42, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 2, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21308, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21312, 0, 0, 32, 1, 42, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 3, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21309, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21313, 0, 0, 32, 1, 42, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 4, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void heartline_twister_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21386, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21390, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 13, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21387, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21391, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 14, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21388, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21392, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 15, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21389, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21393, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 16, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21330, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21334, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 13, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21331, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21335, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 14, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21332, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21336, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 15, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21333, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21337, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 16, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void heartline_twister_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21394, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21398, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 17, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21395, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21399, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 18, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21396, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21400, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 19, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21397, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21401, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 20, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21338, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21342, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 17, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21339, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21343, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 18, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21340, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21344, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 19, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21341, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21345, 0, 0, 32, 1, 66, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 20, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void heartline_twister_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21370, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21374, 0, 0, 32, 1, 34, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 5, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21371, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21375, 0, 0, 32, 1, 34, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 6, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21372, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21376, 0, 0, 32, 1, 34, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 7, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21373, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21377, 0, 0, 32, 1, 34, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 8, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21314, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21318, 0, 0, 32, 1, 34, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 5, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21315, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21319, 0, 0, 32, 1, 34, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 6, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21316, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21320, 0, 0, 32, 1, 34, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 7, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21317, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21321, 0, 0, 32, 1, 34, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 8, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void heartline_twister_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + heartline_twister_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void heartline_twister_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + heartline_twister_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void heartline_twister_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + heartline_twister_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void heartline_twister_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + heartline_twister_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void heartline_twister_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + heartline_twister_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void heartline_twister_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + heartline_twister_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void heartline_twister_rc_track_heartline_transfer_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21306, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21310, 0, 0, 32, 20, 0, height, 0, 6, height + 23); + wooden_a_supports_paint_setup(6, 1, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21307, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21311, 0, 0, 32, 20, 0, height, 0, 6, height + 23); + wooden_a_supports_paint_setup(7, 2, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21308, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21312, 0, 0, 32, 20, 0, height, 0, 6, height + 23); + wooden_a_supports_paint_setup(6, 3, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21309, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21313, 0, 0, 32, 20, 0, height, 0, 6, height + 23); + wooden_a_supports_paint_setup(7, 4, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21314, 0, 0, 32, 20, 2, height + 8, 0, 6, height + 8); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21308, 0, 0, 32, 20, 2, height + 16, 0, 6, height + 16); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21318, 0, 0, 32, 1, 34, height + 8, 0, 27, height + 8); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21312, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); + wooden_a_supports_paint_setup(6, 5, height + 8, 0x00000000, NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21315, 0, 0, 32, 20, 2, height + 8, 0, 6, height + 8); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21309, 0, 0, 32, 20, 2, height + 16, 0, 6, height + 16); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21319, 0, 0, 32, 1, 34, height + 8, 0, 27, height + 8); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21313, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); + wooden_a_supports_paint_setup(7, 6, height + 8, 0x00000000, NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21316, 0, 0, 32, 20, 2, height + 8, 0, 6, height + 8); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21306, 0, 0, 32, 20, 2, height + 16, 0, 6, height + 16); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21320, 0, 0, 32, 1, 34, height + 8, 0, 27, height + 8); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21310, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); + wooden_a_supports_paint_setup(6, 7, height + 8, 0x00000000, NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21317, 0, 0, 32, 20, 2, height + 8, 0, 6, height + 8); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21307, 0, 0, 32, 20, 2, height + 16, 0, 6, height + 16); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21321, 0, 0, 32, 1, 34, height + 8, 0, 27, height + 8); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21311, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); + wooden_a_supports_paint_setup(7, 8, height + 8, 0x00000000, NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21298, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21302, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21299, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21303, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21300, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21304, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21301, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21305, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21316, 0, 0, 32, 20, 2, height - 8, 0, 6, height - 7); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21320, 0, 0, 32, 1, 34, height - 8, 0, 27, height - 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21317, 0, 0, 32, 20, 2, height - 8, 0, 6, height - 7); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21321, 0, 0, 32, 1, 34, height - 8, 0, 27, height - 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21314, 0, 0, 32, 20, 2, height - 8, 0, 6, height - 7); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21318, 0, 0, 32, 1, 34, height - 8, 0, 27, height - 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21315, 0, 0, 32, 20, 2, height - 8, 0, 6, height - 7); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21319, 0, 0, 32, 1, 34, height - 8, 0, 27, height - 8); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height - 16, TUNNEL_0); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void heartline_twister_rc_track_heartline_transfer_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21316, 0, 0, 32, 20, 2, height - 8, 0, 6, height - 7); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21320, 0, 0, 32, 1, 34, height - 8, 0, 27, height - 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21317, 0, 0, 32, 20, 2, height - 8, 0, 6, height - 7); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21321, 0, 0, 32, 1, 34, height - 8, 0, 27, height - 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21314, 0, 0, 32, 20, 2, height - 8, 0, 6, height - 7); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21318, 0, 0, 32, 1, 34, height - 8, 0, 27, height - 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21315, 0, 0, 32, 20, 2, height - 8, 0, 6, height - 7); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21319, 0, 0, 32, 1, 34, height - 8, 0, 27, height - 8); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height - 16, TUNNEL_0); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21314, 0, 0, 32, 20, 2, height + 8, 0, 6, height + 8); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21308, 0, 0, 32, 20, 2, height + 16, 0, 6, height + 16); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21318, 0, 0, 32, 1, 34, height + 8, 0, 27, height + 8); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21312, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); + wooden_a_supports_paint_setup(6, 5, height + 8, 0x00000000, NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21315, 0, 0, 32, 20, 2, height + 8, 0, 6, height + 8); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21309, 0, 0, 32, 20, 2, height + 16, 0, 6, height + 16); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21319, 0, 0, 32, 1, 34, height + 8, 0, 27, height + 8); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21313, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); + wooden_a_supports_paint_setup(7, 6, height + 8, 0x00000000, NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21316, 0, 0, 32, 20, 2, height + 8, 0, 6, height + 8); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21306, 0, 0, 32, 20, 2, height + 16, 0, 6, height + 16); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21320, 0, 0, 32, 1, 34, height + 8, 0, 27, height + 8); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21310, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); + wooden_a_supports_paint_setup(6, 7, height + 8, 0x00000000, NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21317, 0, 0, 32, 20, 2, height + 8, 0, 6, height + 8); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21307, 0, 0, 32, 20, 2, height + 16, 0, 6, height + 16); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21321, 0, 0, 32, 1, 34, height + 8, 0, 27, height + 8); + sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21311, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); + wooden_a_supports_paint_setup(7, 8, height + 8, 0x00000000, NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21298, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21302, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21299, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21303, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21300, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21304, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21301, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21305, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21306, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21310, 0, 0, 32, 20, 0, height, 0, 6, height + 23); + wooden_a_supports_paint_setup(6, 1, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21307, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21311, 0, 0, 32, 20, 0, height, 0, 6, height + 23); + wooden_a_supports_paint_setup(7, 2, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21308, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21312, 0, 0, 32, 20, 0, height, 0, 6, height + 23); + wooden_a_supports_paint_setup(6, 3, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21309, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21313, 0, 0, 32, 20, 0, height, 0, 6, height + 23); + wooden_a_supports_paint_setup(7, 4, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void heartline_twister_rc_track_left_heartline_roll(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21410, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21422, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21413, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21425, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21416, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21428, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21419, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21431, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21411, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21423, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21414, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21426, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21417, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21429, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21420, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21432, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21412, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21424, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21415, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21427, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21418, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21430, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21421, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21433, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21418, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21430, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21421, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21433, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21412, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21424, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21415, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21427, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21417, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21429, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21420, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21432, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21411, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21423, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21414, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21426, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21416, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21428, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21419, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21431, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21410, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21422, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21413, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21425, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void heartline_twister_rc_track_right_heartline_roll(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21434, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21446, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21437, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21449, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21440, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21452, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21443, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21455, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21435, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21447, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21438, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21450, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21441, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21453, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21444, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21456, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21436, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21448, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21439, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21451, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21442, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21454, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21445, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21457, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21442, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21454, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21445, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21457, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21436, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21448, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21439, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21451, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21441, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21453, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21444, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21456, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21435, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21447, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21438, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21450, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21440, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21452, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21443, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21455, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21434, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21446, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21437, 0, 0, 32, 20, 2, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21449, 0, 0, 32, 1, 26, height, 0, 27, height); + wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +TRACK_PAINT_FUNCTION get_track_paint_function_heartline_twister_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return heartline_twister_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return heartline_twister_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return heartline_twister_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return heartline_twister_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return heartline_twister_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return heartline_twister_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return heartline_twister_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return heartline_twister_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return heartline_twister_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return heartline_twister_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return heartline_twister_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return heartline_twister_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return heartline_twister_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_HEARTLINE_TRANSFER_UP: + return heartline_twister_rc_track_heartline_transfer_up; + case TRACK_ELEM_HEARTLINE_TRANSFER_DOWN: + return heartline_twister_rc_track_heartline_transfer_down; + case TRACK_ELEM_LEFT_HEARTLINE_ROLL: + return heartline_twister_rc_track_left_heartline_roll; + case TRACK_ELEM_RIGHT_HEARTLINE_ROLL: + return heartline_twister_rc_track_right_heartline_roll; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 26f3ba9190..bf9da02949 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6307,7 +6307,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_suspended_monorail, // RIDE_TYPE_SUSPENDED_MONORAIL 0, // RIDE_TYPE_LAY_DOWN_ROLLER_COASTER_ALT get_track_paint_function_reverser_rc, // RIDE_TYPE_REVERSER_ROLLER_COASTER - 0, // RIDE_TYPE_HEARTLINE_TWISTER_COASTER + get_track_paint_function_heartline_twister_rc, // RIDE_TYPE_HEARTLINE_TWISTER_COASTER get_track_paint_function_mini_golf, // RIDE_TYPE_MINI_GOLF 0, // RIDE_TYPE_GIGA_COASTER get_track_paint_function_roto_drop, // RIDE_TYPE_ROTO_DROP diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 6900870a43..73a9c28058 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -313,6 +313,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_mini_helicopters(int trackType, in TRACK_PAINT_FUNCTION get_track_paint_function_lay_down_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_suspended_monorail(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_reverser_rc(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_heartline_twister_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_mini_golf(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_roto_drop(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_flying_saucers(int trackType, int direction); From e16da47ef89c4b11d852210762b4ca742c72e033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 14:59:31 +0200 Subject: [PATCH 21/55] Add generated Giga coaster --- src/ride/coaster/giga_coaster.c | 6291 +++++++++++++++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 6293 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/giga_coaster.c b/src/ride/coaster/giga_coaster.c index 846fd9695d..6bab5c5764 100644 --- a/src/ride/coaster/giga_coaster.c +++ b/src/ride/coaster/giga_coaster.c @@ -13,3 +13,6294 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void giga_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_cable_lift(mapElement)) { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18692, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18693, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18382, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18383, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18384, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18385, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18074, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18075, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void giga_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_cable_lift(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18702, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18703, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18704, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18705, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18394, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18395, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18396, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18397, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18134, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18135, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18136, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18137, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void giga_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_cable_lift(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18718, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18719, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18720, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18721, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18150, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18151, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18152, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18153, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void giga_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_cable_lift(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18694, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18695, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18696, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18697, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18386, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18387, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18388, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18389, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18126, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18127, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18128, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18129, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void giga_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_cable_lift(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18706, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18707, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18710, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18708, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18711, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18709, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18138, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18139, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18142, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18140, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18143, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18141, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void giga_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_cable_lift(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18712, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18713, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18716, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18714, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18717, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18715, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18144, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18145, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18148, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18146, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18149, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18147, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void giga_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_cable_lift(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18698, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18699, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18700, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18701, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18390, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18391, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18392, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18393, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18130, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18131, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18132, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18133, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void giga_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18189, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18194, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18199, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18184, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18188, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18193, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18198, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18183, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18187, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18192, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18197, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18182, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18186, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18191, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18196, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18181, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18185, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18190, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18195, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18180, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + giga_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void giga_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18086, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18094, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18087, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18095, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18088, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18089, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void giga_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18090, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18091, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18092, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18096, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18093, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18097, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void giga_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18092, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18096, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18093, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18097, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18090, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18091, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void giga_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18088, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18089, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18086, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18094, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18087, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18095, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void giga_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18209, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18220, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18214, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18219, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18204, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18208, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18213, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18218, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18203, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18207, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18212, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18217, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18202, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18206, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18211, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18216, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18201, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18205, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18210, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18215, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18221, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18200, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + giga_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void giga_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18098, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18102, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18099, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18103, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18100, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18101, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void giga_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18104, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18105, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18106, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18108, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18107, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18109, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void giga_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18110, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18114, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18111, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18115, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18112, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18113, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void giga_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18116, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18117, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18118, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18120, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18119, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18121, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void giga_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18122, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18123, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18124, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18125, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void giga_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18274, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18279, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18284, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18289, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18275, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18280, 0, 0, 32, 16, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18285, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18290, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18276, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18281, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18286, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18291, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18277, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18282, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18287, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18292, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18278, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18283, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18288, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18293, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void giga_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18254, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18259, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18264, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18269, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18255, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18260, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18265, 0, 0, 32, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18270, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18256, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18261, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18266, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18271, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18257, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18262, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18267, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18272, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18258, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18263, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18268, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18273, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void giga_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + giga_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void giga_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + giga_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void giga_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18238, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18242, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18241, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18245, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18239, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18243, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18240, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18244, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18240, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18244, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18239, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18243, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18241, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18245, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18238, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18242, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18246, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18250, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18249, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18253, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18247, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18251, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18248, 0, 0, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18252, 0, 0, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18248, 0, 0, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18252, 0, 0, 32, 26, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18247, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18251, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18249, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18253, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18246, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18250, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18159, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18162, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18165, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18156, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18158, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18161, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18164, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18155, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18157, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18160, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18163, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18154, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + giga_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void giga_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18171, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18178, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18174, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18177, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18168, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18170, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18173, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18176, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18167, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18169, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18172, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18175, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18179, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18166, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + giga_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void giga_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18305, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18307, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18309, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18303, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18304, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18306, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18308, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18302, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void giga_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18294, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18296, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18298, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18300, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18295, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18297, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18299, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18301, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void giga_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + giga_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void giga_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + giga_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void giga_rc_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18329, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18336, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18332, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18335, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18326, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18328, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18331, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18334, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18325, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18327, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18330, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18333, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18337, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18324, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18326, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18329, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18336, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18332, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18335, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18325, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18328, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18331, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18334, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18324, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18327, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18330, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18333, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18337, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18310, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18313, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18316, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18319, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18323, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18311, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18314, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18317, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18320, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18312, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18315, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18322, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18318, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18321, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18313, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18316, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18319, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18323, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18310, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18314, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18317, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18320, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18311, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18315, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18322, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18318, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18321, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18312, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + giga_rc_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void giga_rc_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + giga_rc_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void giga_rc_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18369, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18380, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18374, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18379, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18364, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18368, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18373, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18378, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18363, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18367, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18372, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18377, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18362, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18366, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18371, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18376, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18361, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18365, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18370, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18375, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18381, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18360, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18364, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18369, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18380, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18374, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18379, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18363, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18368, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18373, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18378, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18362, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18367, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18372, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18377, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18361, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18366, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18371, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18376, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18360, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18365, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18370, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18375, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18381, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18338, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18343, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18348, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18353, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18359, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18339, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18344, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18349, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18354, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18340, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18345, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18350, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18355, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18341, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18346, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18351, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18356, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18342, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18347, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18358, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18352, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18357, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18343, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18348, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18353, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18359, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18338, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18344, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18349, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18354, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18339, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18345, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18350, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18355, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18340, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18346, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18351, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18356, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18341, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18347, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18358, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18352, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18357, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18342, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + giga_rc_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void giga_rc_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + giga_rc_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void giga_rc_track_left_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18231, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18235, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18232, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18236, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18233, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18237, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18230, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18234, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_left(height - 8, TUNNEL_8); + break; + case 2: + paint_util_push_tunnel_right(height + 56, TUNNEL_7); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_7); + paint_util_push_tunnel_left(height + 56, TUNNEL_7); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void giga_rc_track_right_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18222, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18226, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18223, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18227, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18224, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18228, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18225, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18229, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 56, TUNNEL_7); + paint_util_push_tunnel_left(height - 8, TUNNEL_7); + break; + case 1: + paint_util_push_tunnel_left(height + 56, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_7); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void giga_rc_track_left_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_right_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void giga_rc_track_right_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_left_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void giga_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18078, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18082, 0, 0, 32, 1, 11, height, 0, 27, height + 5); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18079, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18083, 0, 0, 32, 1, 11, height, 0, 27, height + 5); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void giga_rc_track_25_deg_up_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18560, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18561, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18562, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18563, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void giga_rc_track_25_deg_up_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18564, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18565, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18566, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18567, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void giga_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, 0x20000000 | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18074, 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(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18075, 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(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18074, 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(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18075, 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); + 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); +} + +static void giga_rc_track_25_deg_down_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_25_deg_up_right_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_25_deg_down_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_25_deg_up_left_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_flat_to_60_deg_up_long_base(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_cable_lift(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18722, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18726, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18730, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18734, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18660, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18664, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18668, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18672, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_cable_lift(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18723, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18727, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18731, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18735, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 5, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18661, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18665, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18669, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18673, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 5, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_cable_lift(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18724, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18728, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18732, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18736, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18662, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18666, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18670, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18674, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + if (track_element_is_cable_lift(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18725, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18729, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18733, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18737, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18663, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18667, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18671, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18675, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height + 24, TUNNEL_8); + break; + case 2: + paint_util_push_tunnel_left(height + 24, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + } +} + +static void giga_rc_track_60_deg_up_to_flat_long_base(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18676, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18680, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18684, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18688, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18677, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18681, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18685, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18689, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18678, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18682, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18686, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18690, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18679, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18683, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18687, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18691, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 5, height, gTrackColours[SCHEME_SUPPORTS]); + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); + break; + } +} + +static void giga_rc_track_flat_to_60_deg_down_long_base(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_flat_to_60_deg_up_long_base(rideIndex, 3 - trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_60_deg_up_to_flat_long_base122(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_60_deg_up_to_flat_long_base(rideIndex, 3 - trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_cable_lift_hill(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18698, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18699, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18700, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18701, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18700, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18701, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18698, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18699, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18714, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18717, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18715, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18712, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18713, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18716, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } else { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18720, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18721, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18718, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18719, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_8); + } else { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void giga_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18414, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18418, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18422, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18426, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18415, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18419, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18423, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18427, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18416, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18420, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18424, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18428, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18417, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18421, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18425, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18429, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18398, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18402, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18406, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18410, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18399, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18403, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18407, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18411, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18400, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18404, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18408, 0, 0, 28, 28, 3, height, 4, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18412, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18401, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18405, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18409, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18413, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + giga_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + giga_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void giga_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18446, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18450, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18454, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18458, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18447, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18451, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18455, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18459, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18448, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18452, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18456, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18460, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18449, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18453, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18457, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18461, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18430, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18434, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18438, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18442, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18431, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18435, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18439, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18443, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18432, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18436, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18440, 0, 0, 28, 28, 0, height, 4, 4, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18444, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18433, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18437, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18441, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18445, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + giga_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + giga_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void giga_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18527, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18465, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18524, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18462, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18526, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18464, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18525, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18463, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18539, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18477, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18536, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18474, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18538, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18476, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18537, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18475, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void giga_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18489, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18486, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18488, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18487, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 32, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void giga_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18531, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18469, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18528, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18466, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18530, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18468, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18529, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18467, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void giga_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18481, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18478, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18480, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18479, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void giga_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18485, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18482, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18484, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18483, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(0, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void giga_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18535, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18473, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18532, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18470, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18534, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18472, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18533, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18471, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void giga_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18537, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18475, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18538, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18476, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18536, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18474, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18539, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18477, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void giga_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18487, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18488, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18486, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18489, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 24, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void giga_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18533, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18471, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18534, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18472, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18532, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18470, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18535, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18473, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void giga_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18483, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18484, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18482, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18485, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void giga_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18479, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18480, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18478, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18481, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void giga_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18529, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18467, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18530, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18468, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18528, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18466, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18531, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18469, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void giga_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18497, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18494, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18498, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18496, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18495, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18502, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18499, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18501, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18503, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18500, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18500, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18501, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18503, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18499, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18502, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18495, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18496, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18494, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18498, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18497, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18517, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18514, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18518, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18516, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18515, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void giga_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18522, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18519, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18521, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18523, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18520, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void giga_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18507, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18504, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18508, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18506, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18505, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void giga_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18512, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18509, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18511, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18513, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18510, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void giga_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18510, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18511, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18513, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18509, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18512, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void giga_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18505, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18506, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18504, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18508, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18507, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void giga_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18520, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18521, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18523, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18519, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18522, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void giga_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18515, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18516, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18514, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18518, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18517, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void giga_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18493, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18490, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18492, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18491, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18491, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18492, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18490, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18493, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void giga_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18076, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18080, 0, 0, 32, 1, 11, height, 0, 27, height + 5); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18077, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18081, 0, 0, 32, 1, 11, height, 0, 27, height + 5); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void giga_rc_track_left_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18655, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18657, 0, 6, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18659, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18653, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18654, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18656, 6, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18658, 6, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18652, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void giga_rc_track_right_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18644, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18646, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18648, 0, 6, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18650, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18645, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18647, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18649, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18651, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void giga_rc_track_left_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + giga_rc_track_right_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void giga_rc_track_right_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + giga_rc_track_left_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void giga_rc_track_left_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18624, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18629, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18634, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18639, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18625, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18630, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18635, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18640, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18626, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18631, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18636, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18641, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18627, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18632, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18637, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18642, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18628, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18633, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18638, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18643, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void giga_rc_track_right_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18604, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18609, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18614, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18619, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18605, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18610, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18615, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18620, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18606, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18611, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18616, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18621, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18607, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18612, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18617, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18622, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18608, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18613, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18618, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18623, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void giga_rc_track_left_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + giga_rc_track_right_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void giga_rc_track_right_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + giga_rc_track_left_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void giga_rc_track_25_deg_up_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18568, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18569, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18576, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18570, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18571, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void giga_rc_track_25_deg_up_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18572, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18573, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18574, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18577, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18575, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void giga_rc_track_left_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18578, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18579, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18586, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18580, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18581, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void giga_rc_track_right_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18582, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18583, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18584, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18587, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18585, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void giga_rc_track_25_deg_down_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_right_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_25_deg_down_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_left_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_left_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_25_deg_up_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_right_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_25_deg_up_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_left_banked_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18588, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18589, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18590, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18591, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void giga_rc_track_right_banked_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18592, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18593, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18594, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18595, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void giga_rc_track_left_banked_25_deg_up_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18596, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18597, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18598, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18599, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void giga_rc_track_right_banked_25_deg_up_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18600, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18601, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18602, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18603, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void giga_rc_track_left_banked_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_right_banked_25_deg_up_to_right_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_right_banked_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_left_banked_25_deg_up_to_left_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_left_banked_25_deg_down_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_right_banked_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_right_banked_25_deg_down_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_left_banked_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18540, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18541, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18548, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18542, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18543, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void giga_rc_track_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18544, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18545, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18546, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18549, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18547, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void giga_rc_track_left_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18550, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18551, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18558, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18552, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18553, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void giga_rc_track_right_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18554, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18555, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18556, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18559, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18557, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void giga_rc_track_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_right_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_left_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_left_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void giga_rc_track_right_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + giga_rc_track_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_giga_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return giga_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return giga_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return giga_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return giga_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return giga_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return giga_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return giga_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return giga_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return giga_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return giga_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return giga_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return giga_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return giga_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return giga_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return giga_rc_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return giga_rc_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return giga_rc_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return giga_rc_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return giga_rc_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return giga_rc_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return giga_rc_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return giga_rc_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return giga_rc_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return giga_rc_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return giga_rc_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return giga_rc_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return giga_rc_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return giga_rc_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return giga_rc_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return giga_rc_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return giga_rc_track_right_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: + return giga_rc_track_left_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: + return giga_rc_track_right_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return giga_rc_track_left_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return giga_rc_track_right_quarter_turn_5_25_deg_down; + case TRACK_ELEM_S_BEND_LEFT: + return giga_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return giga_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return giga_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return giga_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return giga_rc_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return giga_rc_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return giga_rc_track_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return giga_rc_track_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return giga_rc_track_left_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return giga_rc_track_right_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: + return giga_rc_track_left_half_banked_helix_up_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: + return giga_rc_track_right_half_banked_helix_up_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: + return giga_rc_track_left_half_banked_helix_down_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: + return giga_rc_track_right_half_banked_helix_down_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: + return giga_rc_track_left_half_banked_helix_up_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: + return giga_rc_track_right_half_banked_helix_up_large; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: + return giga_rc_track_left_half_banked_helix_down_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: + return giga_rc_track_right_half_banked_helix_down_large; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP: + return giga_rc_track_left_quarter_turn_1_60_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP: + return giga_rc_track_right_quarter_turn_1_60_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return giga_rc_track_left_quarter_turn_1_60_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return giga_rc_track_right_quarter_turn_1_60_deg_down; + case TRACK_ELEM_BRAKES: + return giga_rc_track_brakes; + case TRACK_ELEM_25_DEG_UP_LEFT_BANKED: + return giga_rc_track_25_deg_up_left_banked; + case TRACK_ELEM_25_DEG_UP_RIGHT_BANKED: + return giga_rc_track_25_deg_up_right_banked; + case TRACK_ELEM_ON_RIDE_PHOTO: + return giga_rc_track_on_ride_photo; + case TRACK_ELEM_25_DEG_DOWN_LEFT_BANKED: + return giga_rc_track_25_deg_down_left_banked; + case TRACK_ELEM_25_DEG_DOWN_RIGHT_BANKED: + return giga_rc_track_25_deg_down_right_banked; + case TRACK_ELEM_FLAT_TO_60_DEG_UP_LONG_BASE: + return giga_rc_track_flat_to_60_deg_up_long_base; + case TRACK_ELEM_60_DEG_UP_TO_FLAT_LONG_BASE: + return giga_rc_track_60_deg_up_to_flat_long_base; + case TRACK_ELEM_FLAT_TO_60_DEG_DOWN_LONG_BASE: + return giga_rc_track_flat_to_60_deg_down_long_base; + case TRACK_ELEM_60_DEG_UP_TO_FLAT_LONG_BASE_122: + return giga_rc_track_60_deg_up_to_flat_long_base122; + case TRACK_ELEM_CABLE_LIFT_HILL: + return giga_rc_track_cable_lift_hill; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return giga_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return giga_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return giga_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return giga_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + return giga_rc_track_left_eighth_bank_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + return giga_rc_track_right_eighth_bank_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + return giga_rc_track_left_eighth_bank_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + return giga_rc_track_right_eighth_bank_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return giga_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return giga_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP: + return giga_rc_track_diag_60_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return giga_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + return giga_rc_track_diag_25_deg_up_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + return giga_rc_track_diag_60_deg_up_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return giga_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return giga_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN: + return giga_rc_track_diag_60_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return giga_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + return giga_rc_track_diag_25_deg_down_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + return giga_rc_track_diag_60_deg_down_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return giga_rc_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + return giga_rc_track_diag_flat_to_left_bank; + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + return giga_rc_track_diag_flat_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + return giga_rc_track_diag_left_bank_to_flat; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + return giga_rc_track_diag_right_bank_to_flat; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + return giga_rc_track_diag_left_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + return giga_rc_track_diag_right_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + return giga_rc_track_diag_25_deg_up_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + return giga_rc_track_diag_25_deg_up_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + return giga_rc_track_diag_left_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + return giga_rc_track_diag_right_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + return giga_rc_track_diag_25_deg_down_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + return giga_rc_track_diag_25_deg_down_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK: + return giga_rc_track_diag_left_bank; + case TRACK_ELEM_DIAG_RIGHT_BANK: + return giga_rc_track_diag_right_bank; + case TRACK_ELEM_BLOCK_BRAKES: + return giga_rc_track_block_brakes; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return giga_rc_track_left_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return giga_rc_track_right_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return giga_rc_track_left_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return giga_rc_track_right_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return giga_rc_track_left_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return giga_rc_track_right_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return giga_rc_track_left_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return giga_rc_track_right_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANKED_25_DEG_UP: + return giga_rc_track_25_deg_up_to_left_banked_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANKED_25_DEG_UP: + return giga_rc_track_25_deg_up_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return giga_rc_track_left_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return giga_rc_track_right_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANKED_25_DEG_DOWN: + return giga_rc_track_25_deg_down_to_left_banked_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANKED_25_DEG_DOWN: + return giga_rc_track_25_deg_down_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return giga_rc_track_left_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return giga_rc_track_right_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return giga_rc_track_left_banked_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return giga_rc_track_right_banked_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_LEFT_BANKED_FLAT: + return giga_rc_track_left_banked_25_deg_up_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_RIGHT_BANKED_FLAT: + return giga_rc_track_right_banked_25_deg_up_to_right_banked_flat; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return giga_rc_track_left_banked_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return giga_rc_track_right_banked_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_LEFT_BANKED_FLAT: + return giga_rc_track_left_banked_25_deg_down_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_RIGHT_BANKED_FLAT: + return giga_rc_track_right_banked_25_deg_down_to_right_banked_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return giga_rc_track_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return giga_rc_track_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_FLAT: + return giga_rc_track_left_banked_25_deg_up_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_FLAT: + return giga_rc_track_right_banked_25_deg_up_to_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return giga_rc_track_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return giga_rc_track_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_FLAT: + return giga_rc_track_left_banked_25_deg_down_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_FLAT: + return giga_rc_track_right_banked_25_deg_down_to_flat; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index bf9da02949..cc608978e1 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6309,7 +6309,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_reverser_rc, // RIDE_TYPE_REVERSER_ROLLER_COASTER get_track_paint_function_heartline_twister_rc, // RIDE_TYPE_HEARTLINE_TWISTER_COASTER get_track_paint_function_mini_golf, // RIDE_TYPE_MINI_GOLF - 0, // RIDE_TYPE_GIGA_COASTER + get_track_paint_function_giga_rc, // RIDE_TYPE_GIGA_COASTER get_track_paint_function_roto_drop, // RIDE_TYPE_ROTO_DROP get_track_paint_function_flying_saucers,// RIDE_TYPE_FLYING_SAUCERS get_track_paint_function_crooked_house, // RIDE_TYPE_CROOKED_HOUSE diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 73a9c28058..e68db3f012 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -315,6 +315,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_suspended_monorail(int trackType, TRACK_PAINT_FUNCTION get_track_paint_function_reverser_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_heartline_twister_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_mini_golf(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_giga_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_roto_drop(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_flying_saucers(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_crooked_house(int trackType, int direction); From 56ca9ed0f593a3b04e3354e0691496682edc34cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 15:01:32 +0200 Subject: [PATCH 22/55] Add generated Compact inverted coaster --- src/ride/coaster/compact_inverted_coaster.c | 5710 +++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 5712 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/compact_inverted_coaster.c b/src/ride/coaster/compact_inverted_coaster.c index 846fd9695d..f558da5c68 100644 --- a/src/ride/coaster/compact_inverted_coaster.c +++ b/src/ride/coaster/compact_inverted_coaster.c @@ -13,3 +13,5713 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void compact_inverted_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26557, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26558, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26555, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26556, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void compact_inverted_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26621, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26622, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26623, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26624, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26569, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26570, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26571, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26572, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void compact_inverted_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26637, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 93); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26638, 0, 0, 32, 2, 81, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26639, 0, 0, 32, 2, 81, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26640, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 93); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26585, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 93); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26586, 0, 0, 32, 2, 81, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26587, 0, 0, 32, 2, 81, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26588, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 93); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); +} + +static void compact_inverted_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26613, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26614, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26615, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26616, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26561, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26562, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26563, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26564, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void compact_inverted_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26625, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26629, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26626, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26630, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26627, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26628, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26573, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26577, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26574, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26578, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26575, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26576, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); +} + +static void compact_inverted_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26631, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 70, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26635, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26632, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 70, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26636, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26633, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 70, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26634, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 70, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26579, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 70, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26583, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26580, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 70, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26584, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26581, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 70, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26582, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 70, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); +} + +static void compact_inverted_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26617, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26618, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26619, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26620, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26565, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26566, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26567, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26568, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_13); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void compact_inverted_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26694, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26699, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26704, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26689, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26693, 0, 0, 32, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26698, 0, 0, 32, 16, 3, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26703, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26688, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26692, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26697, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26702, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26687, 0, 0, 16, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26691, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26696, 0, 0, 16, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26701, 0, 0, 16, 32, 3, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26686, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26690, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26695, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26700, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26685, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + compact_inverted_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26657, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26658, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26659, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26660, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void compact_inverted_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26661, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26662, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26663, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26664, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void compact_inverted_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26663, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26664, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26661, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26662, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void compact_inverted_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26659, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26660, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26657, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26658, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void compact_inverted_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26738, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26743, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26748, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26733, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26737, 0, 0, 32, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26742, 0, 0, 32, 16, 3, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26747, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26732, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26736, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26741, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26746, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26731, 0, 0, 16, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26735, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26740, 0, 0, 16, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26745, 0, 0, 16, 32, 3, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26730, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26734, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26739, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26744, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26729, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + compact_inverted_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26665, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26666, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26667, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26668, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void compact_inverted_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26669, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26670, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26671, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26672, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void compact_inverted_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26673, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26674, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26675, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26676, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_13); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void compact_inverted_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26677, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26678, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26679, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26680, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_13); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void compact_inverted_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26681, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26682, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26683, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26684, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void compact_inverted_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26949, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26954, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26959, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26964, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26950, 0, 0, 32, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26955, 0, 0, 32, 16, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26960, 0, 16, 32, 16, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26965, 0, 16, 32, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26951, 0, 16, 16, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26956, 16, 16, 16, 16, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26961, 16, 0, 16, 16, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26966, 0, 0, 16, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26952, 16, 0, 16, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26957, 0, 0, 16, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26962, 0, 0, 16, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26967, 16, 0, 16, 32, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26953, 6, 0, 20, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26958, 6, 0, 20, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26963, 6, 0, 20, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26968, 6, 0, 20, 32, 3, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_5); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void compact_inverted_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26929, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26934, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26939, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26944, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26930, 0, 16, 32, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26935, 0, 16, 32, 16, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26940, 0, 0, 32, 16, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26945, 0, 0, 32, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26931, 0, 0, 16, 16, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26936, 16, 0, 16, 16, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26941, 16, 16, 16, 16, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26946, 0, 16, 16, 16, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26932, 16, 0, 16, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26937, 0, 0, 16, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26942, 0, 0, 16, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26947, 16, 0, 16, 32, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26933, 6, 0, 20, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26938, 6, 0, 20, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26943, 6, 0, 20, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26948, 6, 0, 20, 32, 3, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_5); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void compact_inverted_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + compact_inverted_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + compact_inverted_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26641, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26645, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26644, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26648, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26642, 0, 0, 32, 26, 3, height + 29); + metal_a_supports_paint_setup(11, 5, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26646, 0, 0, 32, 26, 3, height + 29); + metal_a_supports_paint_setup(11, 6, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26643, 0, 0, 32, 26, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26647, 0, 0, 32, 26, 3, height + 29, 0, 6, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26643, 0, 0, 32, 26, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26647, 0, 0, 32, 26, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26642, 0, 0, 32, 26, 3, height + 29); + metal_a_supports_paint_setup(11, 5, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26646, 0, 0, 32, 26, 3, height + 29); + metal_a_supports_paint_setup(11, 6, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26644, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26648, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26641, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26645, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26649, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26653, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26652, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26656, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26650, 0, 0, 32, 26, 3, height + 29, 0, 6, height + 29); + metal_a_supports_paint_setup(11, 8, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26654, 0, 0, 32, 26, 3, height + 29, 0, 6, height + 29); + metal_a_supports_paint_setup(11, 7, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26651, 0, 0, 32, 26, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26655, 0, 0, 32, 26, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26651, 0, 0, 32, 26, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26655, 0, 0, 32, 26, 3, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26650, 0, 0, 32, 26, 3, height + 29, 0, 6, height + 29); + metal_a_supports_paint_setup(11, 8, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26654, 0, 0, 32, 26, 3, height + 29, 0, 6, height + 29); + metal_a_supports_paint_setup(11, 7, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26652, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26656, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26649, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26653, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_left_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27017, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(11, 6, 0, height + 49, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27025, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(11, 8, 0, height + 49, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27024, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(11, 7, 0, height + 49, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27032, 0, 6, 32, 10, 7, height + 29, 0, 6, height + 45); + metal_a_supports_paint_setup(11, 5, 0, height + 49, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27018, 0, 0, 32, 2, 3, height + 29, 0, 29, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27026, 0, 14, 32, 2, 63, height + 29, 0, 29, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27023, 0, 6, 32, 2, 3, height + 29, 0, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27031, 0, 6, 2, 2, 3, height + 29, 29, 20, height + 29); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27019, 16, 0, 5, 2, 119, height + 2, 16, 29, height + 2); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27027, 12, 0, 32, 2, 119, height + 2, 0, -6, height + 2); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27022, 10, 16, 4, 2, 119, height + 2, 10, 0, height + 2); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27030, 16, 16, 2, 2, 119, height + 2, 29, 29, height + 2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27020, 0, 0, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27028, 0, 0, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27021, 0, 16, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27029, 0, 16, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27021, 0, 16, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27029, 0, 16, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27020, 0, 0, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27028, 0, 0, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27022, 10, 16, 4, 2, 119, height + 2, 10, 0, height + 2); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27030, 16, 16, 2, 2, 119, height + 2, 29, 29, height + 2); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27019, 16, 0, 5, 2, 119, height + 2, 16, 29, height + 2); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27027, 12, 0, 32, 2, 119, height + 2, 0, -6, height + 2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27023, 0, 6, 32, 2, 3, height + 29, 0, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27031, 0, 6, 2, 2, 3, height + 29, 29, 20, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27018, 0, 0, 32, 2, 3, height + 29, 0, 29, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27026, 0, 14, 32, 2, 63, height + 29, 0, 29, height + 29); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27024, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(11, 7, 0, height + 49, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27032, 0, 6, 32, 10, 7, height + 29, 0, 6, height + 45); + metal_a_supports_paint_setup(11, 5, 0, height + 49, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27017, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(11, 6, 0, height + 49, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27025, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(11, 8, 0, height + 49, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_4); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_4); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void compact_inverted_rc_track_right_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27048, 0, 6, 32, 10, 7, height + 29, 0, 6, height + 45); + metal_a_supports_paint_setup(11, 6, 0, height + 49, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27040, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(11, 8, 0, height + 49, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27041, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(11, 7, 0, height + 49, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27033, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(11, 5, 0, height + 49, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27047, 0, 6, 2, 2, 3, height + 29, 29, 20, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27039, 0, 6, 32, 2, 3, height + 29, 0, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27042, 0, 14, 32, 2, 63, height + 29, 0, 29, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27034, 0, 0, 32, 2, 3, height + 29, 0, 29, height + 29); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27046, 16, 16, 2, 2, 119, height + 2, 29, 29, height + 2); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27038, 10, 16, 4, 2, 119, height + 2, 10, 0, height + 2); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27043, 12, 0, 32, 2, 119, height + 2, 0, -6, height + 2); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27035, 16, 0, 5, 2, 119, height + 2, 16, 29, height + 2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27045, 0, 16, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27037, 0, 16, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27044, 0, 0, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27036, 0, 0, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27044, 0, 0, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27036, 0, 0, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27045, 0, 16, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27037, 0, 16, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27043, 12, 0, 32, 2, 119, height + 2, 0, -6, height + 2); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27035, 16, 0, 5, 2, 119, height + 2, 16, 29, height + 2); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27046, 16, 16, 2, 2, 119, height + 2, 29, 29, height + 2); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27038, 10, 16, 4, 2, 119, height + 2, 10, 0, height + 2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27042, 0, 14, 32, 2, 63, height + 29, 0, 29, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27034, 0, 0, 32, 2, 3, height + 29, 0, 29, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27047, 0, 6, 2, 2, 3, height + 29, 29, 20, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27039, 0, 6, 32, 2, 3, height + 29, 0, 0, height + 29); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27041, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(11, 7, 0, height + 49, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27033, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(11, 5, 0, height + 49, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27048, 0, 6, 32, 10, 7, height + 29, 0, 6, height + 45); + metal_a_supports_paint_setup(11, 6, 0, height + 49, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27040, 0, 6, 32, 2, 3, height + 29, 0, 29, height + 29); + metal_a_supports_paint_setup(11, 8, 0, height + 49, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_4); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_4); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void compact_inverted_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26710, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26713, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26716, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26707, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26709, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26712, 0, 0, 16, 16, 3, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26715, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26706, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26708, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26711, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26714, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26705, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + compact_inverted_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26722, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26725, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26728, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26719, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26721, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26724, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26727, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26718, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26720, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26723, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26726, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26717, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + compact_inverted_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26924, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26926, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26928, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26922, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26923, 6, 0, 20, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26925, 6, 0, 20, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26927, 6, 0, 20, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26921, 6, 0, 20, 32, 3, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_5); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void compact_inverted_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26913, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26915, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26917, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26919, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26914, 6, 0, 20, 32, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26916, 6, 0, 20, 32, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26918, 6, 0, 20, 32, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26920, 6, 0, 20, 32, 3, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 46, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_5); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void compact_inverted_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + compact_inverted_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + compact_inverted_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_left_twist_down_to_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26993, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26999, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26998, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27004, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26994, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27000, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26997, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27003, 0, 6, 32, 20, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26995, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27001, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26996, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27002, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_right_twist_down_to_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27005, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27011, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27010, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27016, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27006, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27012, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27009, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27015, 0, 6, 32, 20, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27007, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27013, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27008, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27014, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_left_twist_up_to_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26996, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27002, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26995, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27001, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26997, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27003, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26994, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27000, 0, 6, 32, 20, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26998, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27004, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26993, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26999, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_right_twist_up_to_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27008, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27014, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27007, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27013, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27009, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27015, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27006, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27012, 0, 6, 32, 20, 3, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27010, 0, 6, 32, 20, 3, height + 29); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27016, 0, 6, 32, 20, 3, height + 29); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27005, 0, 6, 32, 20, 3, height + 29); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27011, 0, 6, 32, 20, 3, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_half_loop_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27073, 0, 6, 32, 20, 3, height + 29, 0, 6, height + 45); + metal_a_supports_paint_setup(11, 6, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27081, 0, 6, 32, 20, 3, height + 29, 0, 6, height + 45); + metal_a_supports_paint_setup(11, 8, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27080, 0, 6, 32, 20, 3, height + 29, 0, 6, height + 45); + metal_a_supports_paint_setup(11, 7, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27088, 0, 6, 32, 20, 3, height + 29, 0, 6, height + 45); + metal_a_supports_paint_setup(11, 5, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27074, 0, 0, 32, 2, 3, height + 29, 0, 29, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27082, 0, 14, 32, 2, 63, height + 29, 0, 29, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27079, 0, 6, 32, 2, 3, height + 29, 0, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27087, 0, 6, 2, 2, 3, height + 29, 29, 20, height + 29); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27075, 16, 0, 5, 2, 119, height + 2, 16, 29, height + 2); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27083, 12, 0, 32, 2, 119, height + 2, 0, -6, height + 2); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27078, 10, 16, 4, 2, 119, height + 2, 10, 0, height + 2); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27086, 16, 16, 2, 2, 119, height + 2, 29, 29, height + 2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27076, 0, 0, 32, 20, 3, height + 34, 0, 6, height + 34); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27084, 0, 0, 2, 2, 3, height + 34, 0, 0, height - 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27077, 0, 16, 32, 2, 3, height + 34, 0, 0, height - 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27085, 0, 16, 32, 20, 3, height + 34, 0, 6, height + 34); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 32, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void compact_inverted_rc_track_half_loop_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_half_loop_up(rideIndex, 3 - trackSequence, direction, height, mapElement); +} + +static void compact_inverted_rc_track_left_corkscrew_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27049, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 33); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27052, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 33); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27055, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 33); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27058, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 33); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27050, 0, 0, 20, 20, 3, height + 14, 6, 6, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27053, 0, 0, 20, 20, 3, height + 14, 6, 6, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27056, 0, 0, 20, 20, 3, height + 14, 6, 6, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27059, 0, 0, 20, 20, 3, height + 14, 6, 6, height + 24); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27051, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 39); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27054, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 39); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27057, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 39); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27060, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 39); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 28, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 40, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height + 40, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void compact_inverted_rc_track_right_corkscrew_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27061, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 33); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27064, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 33); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27067, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 33); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27070, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 33); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27062, 0, 0, 20, 20, 3, height + 14, 6, 6, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27065, 0, 0, 20, 20, 3, height + 14, 6, 6, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27068, 0, 0, 20, 20, 3, height + 14, 6, 6, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27071, 0, 0, 20, 20, 3, height + 14, 6, 6, height + 24); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27063, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 39); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27066, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 39); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27069, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 39); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27072, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 39); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 28, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 40, TUNNEL_3); + break; + case 1: + paint_util_push_tunnel_left(height + 40, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void compact_inverted_rc_track_left_corkscrew_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_right_corkscrew_up(rideIndex, 2 - trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_right_corkscrew_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_left_corkscrew_up(rideIndex, 2 - trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_left_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26910, 0, 0, 28, 28, 3, height + 5, 2, 2, height + 5); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26906, 0, 0, 28, 28, 1, height + 5, 2, 2, height + 104); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26911, 0, 0, 28, 28, 3, height + 5, 2, 2, height + 5); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26907, 0, 0, 28, 28, 1, height + 5, 2, 2, height + 104); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26912, 0, 0, 28, 28, 3, height + 5, 2, 2, height + 5); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26908, 0, 0, 28, 28, 1, height + 5, 2, 2, height + 104); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26909, 0, 0, 28, 28, 3, height + 5, 2, 2, height + 5); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26905, 0, 0, 28, 28, 1, height + 5, 2, 2, height + 104); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_left(height - 8, TUNNEL_5); + break; + case 2: + paint_util_push_tunnel_right(height + 56, TUNNEL_4); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_4); + paint_util_push_tunnel_left(height + 56, TUNNEL_4); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void compact_inverted_rc_track_right_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26901, 0, 0, 28, 28, 3, height + 5, 2, 2, height + 5); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26897, 0, 0, 28, 28, 1, height + 5, 2, 2, height + 104); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26902, 0, 0, 28, 28, 3, height + 5, 2, 2, height + 5); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26898, 0, 0, 28, 28, 1, height + 5, 2, 2, height + 104); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26903, 0, 0, 28, 28, 3, height + 5, 2, 2, height + 5); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26899, 0, 0, 28, 28, 1, height + 5, 2, 2, height + 104); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26904, 0, 0, 28, 28, 3, height + 5, 2, 2, height + 5); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26900, 0, 0, 28, 28, 1, height + 5, 2, 2, height + 104); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 56, TUNNEL_4); + paint_util_push_tunnel_left(height - 8, TUNNEL_4); + break; + case 1: + paint_util_push_tunnel_left(height + 56, TUNNEL_5); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_4); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void compact_inverted_rc_track_left_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_right_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_right_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_left_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26559, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26560, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void compact_inverted_rc_track_left_quarter_banked_helix_large_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27118, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27123, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27128, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27113, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27117, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27122, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27127, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27112, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27116, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27121, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27126, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27111, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27115, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27120, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27125, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27110, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27114, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27119, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27124, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27109, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 16, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height + 16, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_right_quarter_banked_helix_large_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27089, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27094, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27099, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27104, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 35); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27090, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27095, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27100, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27105, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27091, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27096, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27101, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27106, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27092, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27097, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27102, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27107, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27093, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27098, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27103, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27108, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 43); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 16, TUNNEL_3); + break; + case 1: + paint_util_push_tunnel_left(height + 16, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_left_quarter_banked_helix_large_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27098, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27103, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27108, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27093, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 16, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27097, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27102, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27107, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27092, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27096, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27101, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27106, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27091, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27095, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27100, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27105, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27090, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27094, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27099, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27104, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27089, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_right_quarter_banked_helix_large_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27109, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27114, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27119, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27124, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 43); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 56, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 16, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27110, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27115, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27120, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27125, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27111, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27116, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27121, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27126, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27112, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27117, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27122, 0, 0, 16, 32, 3, height + 29, 0, 0, height + 43); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27127, 0, 0, 16, 32, 3, height + 29, 16, 0, height + 43); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27113, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27118, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27123, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27128, 0, 0, 20, 32, 3, height + 29, 6, 0, height + 35); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_3); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + 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] | 26555, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + 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] | 26556, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + 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] | 26555, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + 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] | 26556, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + 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); + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void compact_inverted_rc_track_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26609, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26610, 0, 0, 32, 2, 31, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26611, 0, 0, 32, 2, 31, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26612, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26605, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26606, 0, 0, 32, 2, 31, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26607, 0, 0, 32, 2, 31, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26608, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + } + } + paint_util_set_vertical_tunnel(height + 32); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + break; + } +} + +static void compact_inverted_rc_track_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_90_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_60_deg_up_to_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26597, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26598, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26599, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26600, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26589, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26590, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26591, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26592, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_vertical_tunnel(height + 48); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + break; + } +} + +static void compact_inverted_rc_track_90_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + compact_inverted_rc_track_60_deg_up_to_90_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_90_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26601, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26602, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26603, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26604, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26593, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26594, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26595, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26596, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + } + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height + 48, TUNNEL_5); + break; + case 2: + paint_util_push_tunnel_left(height + 48, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 96, 0x20); +} + +static void compact_inverted_rc_track_60_deg_down_to_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26603, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26604, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26601, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26602, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26595, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26596, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26593, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26594, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 48, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 96, 0x20); + break; + case 1: + break; + } +} + +static void compact_inverted_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26765, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26769, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26773, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26777, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26766, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26770, 0, 0, 34, 16, 3, height + 29, 0, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26774, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26778, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26767, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26771, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26775, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26779, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26768, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + metal_a_supports_paint_setup(11, 3, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26772, 0, 0, 16, 18, 3, height + 29, 0, 16, height + 29); + metal_a_supports_paint_setup(11, 1, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26776, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + metal_a_supports_paint_setup(11, 0, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26780, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + metal_a_supports_paint_setup(11, 2, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26749, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26753, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26757, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26761, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26750, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26754, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26758, 0, 0, 34, 16, 3, height + 29, 0, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26762, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26751, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26755, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26759, 0, 0, 28, 28, 3, height + 29, 4, 4, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26763, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26752, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + metal_a_supports_paint_setup(11, 1, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26756, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + metal_a_supports_paint_setup(11, 0, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26760, 0, 0, 16, 18, 3, height + 29, 0, 16, height + 29); + metal_a_supports_paint_setup(11, 2, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26764, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + metal_a_supports_paint_setup(11, 3, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + compact_inverted_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + compact_inverted_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26853, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26857, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26861, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26865, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26854, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26858, 0, 0, 34, 16, 3, height + 29, 0, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26862, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26866, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26855, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26859, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26863, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26867, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26856, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + metal_a_supports_paint_setup(11, 3, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26860, 0, 0, 16, 18, 3, height + 29, 0, 16, height + 29); + metal_a_supports_paint_setup(11, 1, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26864, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + metal_a_supports_paint_setup(11, 0, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26868, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + metal_a_supports_paint_setup(11, 2, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26837, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26841, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26845, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26849, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26838, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26842, 0, 0, 32, 16, 3, height + 29, 0, 16, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26846, 0, 0, 34, 16, 3, height + 29, 0, 0, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26850, 0, 0, 32, 16, 3, height + 29, 0, 0, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26839, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26843, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26847, 0, 0, 28, 28, 3, height + 29, 4, 4, height + 29); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26851, 0, 0, 16, 16, 3, height + 29, 0, 16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26840, 0, 0, 16, 16, 3, height + 29, 16, 0, height + 29); + metal_a_supports_paint_setup(11, 1, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26844, 0, 0, 16, 16, 3, height + 29, 0, 0, height + 29); + metal_a_supports_paint_setup(11, 0, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26848, 0, 0, 16, 18, 3, height + 29, 0, 16, height + 29); + metal_a_supports_paint_setup(11, 2, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26852, 0, 0, 16, 16, 3, height + 29, 16, 16, height + 29); + metal_a_supports_paint_setup(11, 3, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + compact_inverted_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + compact_inverted_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void compact_inverted_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26812, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26784, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26809, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26781, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26811, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26783, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26810, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(11, 0, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26782, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(11, 0, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26824, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26796, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26821, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26793, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26823, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26795, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26822, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + metal_a_supports_paint_setup(11, 0, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26794, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + metal_a_supports_paint_setup(11, 0, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26808, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26805, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26807, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 32, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26806, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_b_supports_paint_setup(11, 0, 36, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 32, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 36, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26816, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26788, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26813, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26785, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26815, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26787, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26814, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(11, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26786, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(11, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26800, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26797, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26799, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 16, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26798, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + metal_b_supports_paint_setup(11, 0, 16, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 16, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 16, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26804, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26801, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26803, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 21, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26802, -16, -16, 16, 16, 3, height + 29, 0, 0, height + 61); + metal_b_supports_paint_setup(11, 0, 21, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 21, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 21, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26820, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26792, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26817, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26789, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26819, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26791, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26818, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(11, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26790, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(11, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26822, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26794, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26823, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26795, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26821, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26793, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26824, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + metal_a_supports_paint_setup(11, 0, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26796, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 45); + metal_a_supports_paint_setup(11, 0, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 50, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26806, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26807, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26805, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 24, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26808, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 93); + metal_b_supports_paint_setup(11, 0, 28, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 24, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 28, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26818, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26790, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26819, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26791, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26817, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26789, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26820, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(11, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26792, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(11, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26802, -16, -16, 16, 16, 3, height + 29, 0, 0, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26803, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26801, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 17, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26804, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + metal_b_supports_paint_setup(11, 0, 17, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 17, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 17, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26798, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26799, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26797, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(11, 1, 8, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26800, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 61); + metal_b_supports_paint_setup(11, 0, 8, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(11, 2, 8, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(11, 3, 8, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26814, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26786, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26815, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26787, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26813, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26785, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26816, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(11, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26788, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(11, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26876, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26873, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26875, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26874, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(11, 0, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26880, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26877, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26879, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26878, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(11, 0, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26878, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26879, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26877, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26880, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(11, 0, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26874, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26875, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26873, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26876, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(11, 0, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26892, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26889, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26891, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26890, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(11, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26896, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26893, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26895, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26894, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(11, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26884, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26881, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26883, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26882, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(11, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26888, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26885, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26887, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26886, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(11, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26886, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26887, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26885, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26888, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(11, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26882, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26883, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26881, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26884, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(11, 0, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26894, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26895, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26893, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26896, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(11, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26890, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26891, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26889, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26892, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 37); + metal_a_supports_paint_setup(11, 0, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 42, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26872, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26869, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26871, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26870, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(11, 0, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26870, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26871, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26869, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(11, 1, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26872, -16, -16, 32, 32, 3, height + 29, -16, -16, height + 29); + metal_a_supports_paint_setup(11, 0, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(11, 2, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(11, 3, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void compact_inverted_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26559, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 26560, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_compact_inverted_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return compact_inverted_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return compact_inverted_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return compact_inverted_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return compact_inverted_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return compact_inverted_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return compact_inverted_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return compact_inverted_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return compact_inverted_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return compact_inverted_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return compact_inverted_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return compact_inverted_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return compact_inverted_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return compact_inverted_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return compact_inverted_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return compact_inverted_rc_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return compact_inverted_rc_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return compact_inverted_rc_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return compact_inverted_rc_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return compact_inverted_rc_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return compact_inverted_rc_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return compact_inverted_rc_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return compact_inverted_rc_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return compact_inverted_rc_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return compact_inverted_rc_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return compact_inverted_rc_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return compact_inverted_rc_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return compact_inverted_rc_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return compact_inverted_rc_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return compact_inverted_rc_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return compact_inverted_rc_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return compact_inverted_rc_track_right_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: + return compact_inverted_rc_track_left_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: + return compact_inverted_rc_track_right_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return compact_inverted_rc_track_left_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return compact_inverted_rc_track_right_quarter_turn_5_25_deg_down; + case TRACK_ELEM_S_BEND_LEFT: + return compact_inverted_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return compact_inverted_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_VERTICAL_LOOP: + return compact_inverted_rc_track_left_vertical_loop; + case TRACK_ELEM_RIGHT_VERTICAL_LOOP: + return compact_inverted_rc_track_right_vertical_loop; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return compact_inverted_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return compact_inverted_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return compact_inverted_rc_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return compact_inverted_rc_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return compact_inverted_rc_track_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return compact_inverted_rc_track_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return compact_inverted_rc_track_left_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return compact_inverted_rc_track_right_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_TWIST_DOWN_TO_UP: + return compact_inverted_rc_track_left_twist_down_to_up; + case TRACK_ELEM_RIGHT_TWIST_DOWN_TO_UP: + return compact_inverted_rc_track_right_twist_down_to_up; + case TRACK_ELEM_LEFT_TWIST_UP_TO_DOWN: + return compact_inverted_rc_track_left_twist_up_to_down; + case TRACK_ELEM_RIGHT_TWIST_UP_TO_DOWN: + return compact_inverted_rc_track_right_twist_up_to_down; + case TRACK_ELEM_HALF_LOOP_UP: + return compact_inverted_rc_track_half_loop_up; + case TRACK_ELEM_HALF_LOOP_DOWN: + return compact_inverted_rc_track_half_loop_down; + case TRACK_ELEM_LEFT_CORKSCREW_UP: + return compact_inverted_rc_track_left_corkscrew_up; + case TRACK_ELEM_RIGHT_CORKSCREW_UP: + return compact_inverted_rc_track_right_corkscrew_up; + case TRACK_ELEM_LEFT_CORKSCREW_DOWN: + return compact_inverted_rc_track_left_corkscrew_down; + case TRACK_ELEM_RIGHT_CORKSCREW_DOWN: + return compact_inverted_rc_track_right_corkscrew_down; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP: + return compact_inverted_rc_track_left_quarter_turn_1_60_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP: + return compact_inverted_rc_track_right_quarter_turn_1_60_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return compact_inverted_rc_track_left_quarter_turn_1_60_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return compact_inverted_rc_track_right_quarter_turn_1_60_deg_down; + case TRACK_ELEM_BRAKES: + return compact_inverted_rc_track_brakes; + case TRACK_ELEM_LEFT_QUARTER_BANKED_HELIX_LARGE_UP: + return compact_inverted_rc_track_left_quarter_banked_helix_large_up; + case TRACK_ELEM_RIGHT_QUARTER_BANKED_HELIX_LARGE_UP: + return compact_inverted_rc_track_right_quarter_banked_helix_large_up; + case TRACK_ELEM_LEFT_QUARTER_BANKED_HELIX_LARGE_DOWN: + return compact_inverted_rc_track_left_quarter_banked_helix_large_down; + case TRACK_ELEM_RIGHT_QUARTER_BANKED_HELIX_LARGE_DOWN: + return compact_inverted_rc_track_right_quarter_banked_helix_large_down; + case TRACK_ELEM_ON_RIDE_PHOTO: + return compact_inverted_rc_track_on_ride_photo; + case TRACK_ELEM_90_DEG_UP: + return compact_inverted_rc_track_90_deg_up; + case TRACK_ELEM_90_DEG_DOWN: + return compact_inverted_rc_track_90_deg_down; + case TRACK_ELEM_60_DEG_UP_TO_90_DEG_UP: + return compact_inverted_rc_track_60_deg_up_to_90_deg_up; + case TRACK_ELEM_90_DEG_DOWN_TO_60_DEG_DOWN: + return compact_inverted_rc_track_90_deg_down_to_60_deg_down; + case TRACK_ELEM_90_DEG_UP_TO_60_DEG_UP: + return compact_inverted_rc_track_90_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_DOWN_TO_90_DEG_DOWN: + return compact_inverted_rc_track_60_deg_down_to_90_deg_down; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return compact_inverted_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return compact_inverted_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return compact_inverted_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return compact_inverted_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + return compact_inverted_rc_track_left_eighth_bank_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + return compact_inverted_rc_track_right_eighth_bank_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + return compact_inverted_rc_track_left_eighth_bank_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + return compact_inverted_rc_track_right_eighth_bank_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return compact_inverted_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return compact_inverted_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP: + return compact_inverted_rc_track_diag_60_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return compact_inverted_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + return compact_inverted_rc_track_diag_25_deg_up_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + return compact_inverted_rc_track_diag_60_deg_up_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return compact_inverted_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return compact_inverted_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN: + return compact_inverted_rc_track_diag_60_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return compact_inverted_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + return compact_inverted_rc_track_diag_25_deg_down_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + return compact_inverted_rc_track_diag_60_deg_down_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return compact_inverted_rc_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + return compact_inverted_rc_track_diag_flat_to_left_bank; + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + return compact_inverted_rc_track_diag_flat_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + return compact_inverted_rc_track_diag_left_bank_to_flat; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + return compact_inverted_rc_track_diag_right_bank_to_flat; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + return compact_inverted_rc_track_diag_left_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + return compact_inverted_rc_track_diag_right_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + return compact_inverted_rc_track_diag_25_deg_up_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + return compact_inverted_rc_track_diag_25_deg_up_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + return compact_inverted_rc_track_diag_left_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + return compact_inverted_rc_track_diag_right_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + return compact_inverted_rc_track_diag_25_deg_down_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + return compact_inverted_rc_track_diag_25_deg_down_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK: + return compact_inverted_rc_track_diag_left_bank; + case TRACK_ELEM_DIAG_RIGHT_BANK: + return compact_inverted_rc_track_diag_right_bank; + case TRACK_ELEM_BLOCK_BRAKES: + return compact_inverted_rc_track_block_brakes; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index cc608978e1..ce6db1c597 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6314,7 +6314,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_flying_saucers,// RIDE_TYPE_FLYING_SAUCERS get_track_paint_function_crooked_house, // RIDE_TYPE_CROOKED_HOUSE get_track_paint_function_monorail_cycles, // RIDE_TYPE_MONORAIL_CYCLES - 0, // RIDE_TYPE_COMPACT_INVERTED_COASTER + get_track_paint_function_compact_inverted_rc, // RIDE_TYPE_COMPACT_INVERTED_COASTER get_track_paint_function_water_rc, // RIDE_TYPE_WATER_COASTER get_track_paint_function_air_powered_vertical_rc, // RIDE_TYPE_AIR_POWERED_VERTICAL_COASTER 0, // RIDE_TYPE_INVERTED_HAIRPIN_COASTER diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index e68db3f012..67e361da61 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -320,6 +320,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_roto_drop(int trackType, int direc TRACK_PAINT_FUNCTION get_track_paint_function_flying_saucers(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_crooked_house(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_monorail_cycles(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_compact_inverted_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_water_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_air_powered_vertical_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_magic_carpet(int trackType, int direction); From 1a0b5b70143f08a00c339ceef63eed33f6314c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 15:13:49 +0200 Subject: [PATCH 23/55] Add generated Inverted hairpin RC --- src/ride/coaster/inverted_hairpin_coaster.c | 903 ++++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 905 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/inverted_hairpin_coaster.c b/src/ride/coaster/inverted_hairpin_coaster.c index 846fd9695d..15b64fc1e8 100644 --- a/src/ride/coaster/inverted_hairpin_coaster.c +++ b/src/ride/coaster/inverted_hairpin_coaster.c @@ -13,3 +13,906 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void inverted_hairpin_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17030, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17031, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17032, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17033, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 22); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17026, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 22); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17027, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 22); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void inverted_hairpin_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17070, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17071, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17072, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17073, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17042, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17043, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17044, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17045, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 40); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 48, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void inverted_hairpin_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17086, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 88); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17087, 0, 0, 32, 2, 81, height + 24, 0, 4, height + 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17088, 0, 0, 32, 2, 81, height + 24, 0, 4, height + 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17089, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 88); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17058, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 88); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17059, 0, 0, 32, 2, 81, height + 24, 0, 4, height + 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17060, 0, 0, 32, 2, 81, height + 24, 0, 4, height + 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17061, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 88); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void inverted_hairpin_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17062, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17063, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17064, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17065, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17034, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17035, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17036, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17037, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 40, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void inverted_hairpin_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17074, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 56); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17078, 0, 0, 32, 10, 49, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17075, 0, 0, 32, 2, 49, height + 24, 0, 4, height + 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17079, 0, 0, 32, 10, 49, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17076, 0, 0, 32, 2, 49, height + 24, 0, 4, height + 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17077, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 56); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17046, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 56); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17050, 0, 0, 32, 10, 49, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17047, 0, 0, 32, 2, 49, height + 24, 0, 4, height + 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17051, 0, 0, 32, 10, 49, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17048, 0, 0, 32, 2, 49, height + 24, 0, 4, height + 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17049, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 56); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void inverted_hairpin_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17080, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 56); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17084, 0, 0, 32, 10, 49, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17081, 0, 0, 32, 2, 49, height + 24, 0, 4, height + 6); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17085, 0, 0, 32, 10, 49, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17082, 0, 0, 32, 2, 49, height + 24, 0, 4, height + 6); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17083, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 56); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17052, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 56); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17056, 0, 0, 32, 10, 49, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17053, 0, 0, 32, 2, 49, height + 24, 0, 4, height + 6); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17057, 0, 0, 32, 10, 49, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17054, 0, 0, 32, 2, 49, height + 24, 0, 4, height + 6); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17055, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 56); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void inverted_hairpin_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17066, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17067, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17068, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17069, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17038, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17039, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17040, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17041, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 32); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void inverted_hairpin_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_hairpin_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_hairpin_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_hairpin_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_hairpin_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_hairpin_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_hairpin_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_hairpin_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_hairpin_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_hairpin_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_hairpin_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_hairpin_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_hairpin_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17123, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17126, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17129, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17120, 0, 0, 32, 20, 3, height + 24, 0, 6, height + 22); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17122, 0, 0, 16, 16, 3, height + 24, 16, 0, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17125, 0, 0, 16, 16, 3, height + 24, 0, 0, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17128, 0, 0, 16, 16, 3, height + 24, 0, 16, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17119, 0, 0, 16, 16, 3, height + 24, 16, 16, height + 22); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17121, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 22); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17124, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 22); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17127, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 22); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17118, 0, 0, 20, 32, 3, height + 24, 6, 0, height + 22); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void inverted_hairpin_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + inverted_hairpin_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17141, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17143, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17145, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17139, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17140, 6, 0, 20, 32, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17142, 6, 0, 20, 32, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17144, 6, 0, 20, 32, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17138, 6, 0, 20, 32, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17130, 0, 6, 32, 20, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17132, 0, 6, 32, 20, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17134, 0, 6, 32, 20, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17136, 0, 6, 32, 20, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17131, 6, 0, 20, 32, 3, height + 24); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17133, 6, 0, 20, 32, 3, height + 24); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17135, 6, 0, 20, 32, 3, height + 24); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17137, 6, 0, 20, 32, 3, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 38, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void inverted_hairpin_rc_track_left_quarter_turn_1(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17114, 0, 0, 26, 24, 3, height + 24, 6, 2, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17115, 0, 0, 26, 26, 3, height + 24, 0, 0, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17116, 0, 0, 24, 26, 3, height + 24, 2, 6, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17117, 0, 0, 24, 24, 3, height + 24, 6, 6, height + 24); + break; + } + metal_a_supports_paint_setup(11, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_right(height, TUNNEL_0); + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void inverted_hairpin_rc_track_right_quarter_turn_1(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_hairpin_rc_track_left_quarter_turn_1(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void inverted_hairpin_rc_track_flat_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17102, 0, 0, 30, 20, 3, height + 24, 0, 6, height + 56); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17106, 0, 0, 32, 10, 49, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17103, 0, 0, 32, 2, 49, height + 24, 0, 4, height + 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17107, 0, 0, 32, 10, 49, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17104, 0, 0, 32, 2, 49, height + 24, 0, 4, height + 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17105, 0, 0, 30, 20, 3, height + 24, 0, 6, height + 56); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17090, 0, 0, 30, 20, 3, height + 24, 0, 6, height + 56); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17094, 0, 0, 32, 10, 49, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17091, 0, 0, 32, 2, 49, height + 24, 0, 4, height + 6); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17095, 0, 0, 32, 10, 49, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17092, 0, 0, 32, 2, 49, height + 24, 0, 4, height + 6); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17093, 0, 0, 30, 20, 3, height + 24, 0, 6, height + 56); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void inverted_hairpin_rc_track_60_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17108, 0, 0, 30, 20, 3, height + 24, 0, 6, height + 48); + metal_a_supports_paint_setup(11, 6, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17112, 0, 0, 32, 10, 41, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17109, 0, 0, 32, 2, 41, height + 24, 0, 4, height + 6); + metal_a_supports_paint_setup(11, 8, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17113, 0, 0, 32, 10, 41, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17110, 0, 0, 32, 2, 41, height + 24, 0, 4, height + 6); + metal_a_supports_paint_setup(11, 7, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17111, 0, 0, 30, 20, 3, height + 24, 0, 6, height + 48); + metal_a_supports_paint_setup(11, 5, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17096, 0, 0, 30, 20, 3, height + 24, 0, 6, height + 48); + metal_a_supports_paint_setup(11, 6, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17100, 0, 0, 32, 10, 41, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17097, 0, 0, 32, 2, 41, height + 24, 0, 4, height + 6); + metal_a_supports_paint_setup(11, 8, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17101, 0, 0, 32, 10, 41, height + 24, 0, 10, height + 6); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17098, 0, 0, 32, 2, 41, height + 24, 0, 4, height + 6); + metal_a_supports_paint_setup(11, 7, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17099, 0, 0, 30, 20, 3, height + 24, 0, 6, height + 48); + metal_a_supports_paint_setup(11, 5, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void inverted_hairpin_rc_track_flat_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_hairpin_rc_track_60_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_hairpin_rc_track_60_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_hairpin_rc_track_flat_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_hairpin_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17028, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 22); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17029, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 22); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void inverted_hairpin_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17028, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 22); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17029, 0, 0, 32, 20, 1, height + 24, 0, 6, height + 22); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 30, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_inverted_hairpin_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return inverted_hairpin_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return inverted_hairpin_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return inverted_hairpin_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return inverted_hairpin_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return inverted_hairpin_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return inverted_hairpin_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return inverted_hairpin_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return inverted_hairpin_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return inverted_hairpin_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return inverted_hairpin_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return inverted_hairpin_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return inverted_hairpin_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return inverted_hairpin_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return inverted_hairpin_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return inverted_hairpin_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return inverted_hairpin_rc_track_left_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return inverted_hairpin_rc_track_right_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE: + return inverted_hairpin_rc_track_left_quarter_turn_1; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE: + return inverted_hairpin_rc_track_right_quarter_turn_1; + case TRACK_ELEM_FLAT_TO_60_DEG_UP: + return inverted_hairpin_rc_track_flat_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_FLAT: + return inverted_hairpin_rc_track_60_deg_up_to_flat; + case TRACK_ELEM_FLAT_TO_60_DEG_DOWN: + return inverted_hairpin_rc_track_flat_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_FLAT: + return inverted_hairpin_rc_track_60_deg_down_to_flat; + case TRACK_ELEM_BRAKES: + return inverted_hairpin_rc_track_brakes; + case TRACK_ELEM_BLOCK_BRAKES: + return inverted_hairpin_rc_track_block_brakes; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index ce6db1c597..2f0e7be193 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6317,7 +6317,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_compact_inverted_rc, // RIDE_TYPE_COMPACT_INVERTED_COASTER get_track_paint_function_water_rc, // RIDE_TYPE_WATER_COASTER get_track_paint_function_air_powered_vertical_rc, // RIDE_TYPE_AIR_POWERED_VERTICAL_COASTER - 0, // RIDE_TYPE_INVERTED_HAIRPIN_COASTER + get_track_paint_function_inverted_hairpin_rc, // RIDE_TYPE_INVERTED_HAIRPIN_COASTER get_track_paint_function_magic_carpet, // RIDE_TYPE_MAGIC_CARPET get_track_paint_function_submarine_ride, // RIDE_TYPE_SUBMARINE_RIDE get_track_paint_function_river_rafts, // RIDE_TYPE_RIVER_RAFTS diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 67e361da61..2c446e448d 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -323,6 +323,7 @@ TRACK_PAINT_FUNCTION get_track_paint_function_monorail_cycles(int trackType, int TRACK_PAINT_FUNCTION get_track_paint_function_compact_inverted_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_water_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_air_powered_vertical_rc(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_inverted_hairpin_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_magic_carpet(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_submarine_ride(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_river_rafts(int trackType, int direction); From 4fa2f4a351f8d7f5384ca7ad9f87e57a6742a671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 15:19:53 +0200 Subject: [PATCH 24/55] Add generated Inverted impulse RC --- src/ride/coaster/inverted_impulse_coaster.c | 483 ++++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 485 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/inverted_impulse_coaster.c b/src/ride/coaster/inverted_impulse_coaster.c index 846fd9695d..51ee56c6e7 100644 --- a/src/ride/coaster/inverted_impulse_coaster.c +++ b/src/ride/coaster/inverted_impulse_coaster.c @@ -13,3 +13,486 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void inverted_impulse_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19662, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19663, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 4, 0, height + 44, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void inverted_impulse_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19672, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 6, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19673, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 8, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19674, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 7, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19675, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 45); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(11, 5, 0, height + 62, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void inverted_impulse_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19688, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 93); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19689, 0, 0, 32, 2, 81, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19690, 0, 0, 32, 2, 81, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19691, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 93); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 120, 0x20); +} + +static void inverted_impulse_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19664, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + metal_a_supports_paint_setup(11, 6, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19665, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + metal_a_supports_paint_setup(11, 8, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19666, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + metal_a_supports_paint_setup(11, 7, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19667, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + metal_a_supports_paint_setup(11, 5, 0, height + 54, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); +} + +static void inverted_impulse_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19676, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19680, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19677, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19681, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19678, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19679, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); +} + +static void inverted_impulse_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19682, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19686, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19683, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19687, 0, 0, 32, 10, 49, height + 29, 0, 10, height + 11); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19684, 0, 0, 32, 2, 49, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19685, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); +} + +static void inverted_impulse_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19668, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + metal_a_supports_paint_setup(11, 6, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19669, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + metal_a_supports_paint_setup(11, 8, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19670, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + metal_a_supports_paint_setup(11, 7, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19671, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 37); + metal_a_supports_paint_setup(11, 5, 0, height + 52, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_3); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_13); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void inverted_impulse_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_impulse_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_impulse_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_impulse_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_impulse_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_impulse_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_impulse_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_impulse_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_impulse_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_impulse_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_impulse_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_impulse_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_impulse_rc_track_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19700, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19701, 0, 0, 32, 2, 31, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19702, 0, 0, 32, 2, 31, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19703, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 61); + break; + } + paint_util_set_vertical_tunnel(height + 32); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + break; + } +} + +static void inverted_impulse_rc_track_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_impulse_rc_track_90_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_impulse_rc_track_60_deg_up_to_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19692, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19693, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19694, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19695, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_4); + } + paint_util_set_vertical_tunnel(height + 48); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + break; + } +} + +static void inverted_impulse_rc_track_90_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_impulse_rc_track_60_deg_up_to_90_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void inverted_impulse_rc_track_90_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19696, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19697, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19698, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19699, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height + 48, TUNNEL_5); + break; + case 2: + paint_util_push_tunnel_left(height + 48, TUNNEL_5); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 96, 0x20); +} + +static void inverted_impulse_rc_track_60_deg_down_to_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19698, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19699, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19696, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 85); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19697, 0, 0, 32, 2, 55, height + 29, 0, 4, height + 11); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 48, TUNNEL_5); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 96, 0x20); + break; + case 1: + break; + } +} + +static void inverted_impulse_rc_track_left_quarter_turn_1_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19708, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 125); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19709, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 125); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19717, 0, 0, 2, 32, 31, height + 29, 4, 0, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19710, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 125); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19718, 0, 0, 32, 2, 31, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19711, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 125); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19719, 0, 0, 32, 2, 31, height + 29, 0, 4, height + 11); + break; + } + paint_util_set_vertical_tunnel(height + 96); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 96, 0x20); + break; + case 1: + break; + } +} + +static void inverted_impulse_rc_track_right_quarter_turn_1_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19704, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 125); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19712, 0, 0, 32, 2, 31, height + 29, 0, 4, height + 11); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19705, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 125); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19713, 0, 0, 32, 2, 31, height + 29, 0, 4, height + 11); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19706, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 125); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19714, 0, 0, 32, 2, 31, height + 29, 0, 4, height + 11); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19707, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 125); + break; + } + paint_util_set_vertical_tunnel(height + 96); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 96, 0x20); + break; + case 1: + break; + } +} + +static void inverted_impulse_rc_track_left_quarter_turn_1_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_impulse_rc_track_right_quarter_turn_1_90_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void inverted_impulse_rc_track_right_quarter_turn_1_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + inverted_impulse_rc_track_left_quarter_turn_1_90_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_inverted_impulse_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return inverted_impulse_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return inverted_impulse_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return inverted_impulse_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return inverted_impulse_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return inverted_impulse_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return inverted_impulse_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return inverted_impulse_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return inverted_impulse_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return inverted_impulse_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return inverted_impulse_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return inverted_impulse_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return inverted_impulse_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return inverted_impulse_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_90_DEG_UP: + return inverted_impulse_rc_track_90_deg_up; + case TRACK_ELEM_90_DEG_DOWN: + return inverted_impulse_rc_track_90_deg_down; + case TRACK_ELEM_60_DEG_UP_TO_90_DEG_UP: + return inverted_impulse_rc_track_60_deg_up_to_90_deg_up; + case TRACK_ELEM_90_DEG_DOWN_TO_60_DEG_DOWN: + return inverted_impulse_rc_track_90_deg_down_to_60_deg_down; + case TRACK_ELEM_90_DEG_UP_TO_60_DEG_UP: + return inverted_impulse_rc_track_90_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_DOWN_TO_90_DEG_DOWN: + return inverted_impulse_rc_track_60_deg_down_to_90_deg_down; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_90_DEG_UP: + return inverted_impulse_rc_track_left_quarter_turn_1_90_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_90_DEG_UP: + return inverted_impulse_rc_track_right_quarter_turn_1_90_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_90_DEG_DOWN: + return inverted_impulse_rc_track_left_quarter_turn_1_90_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_90_DEG_DOWN: + return inverted_impulse_rc_track_right_quarter_turn_1_90_deg_down; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 2f0e7be193..cc2f470067 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6327,7 +6327,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_shop, // RIDE_TYPE_53 get_track_paint_function_shop, // RIDE_TYPE_54 0, // RIDE_TYPE_55 - 0, // RIDE_TYPE_INVERTED_IMPULSE_COASTER + get_track_paint_function_inverted_impulse_rc, // RIDE_TYPE_INVERTED_IMPULSE_COASTER 0, // RIDE_TYPE_MINI_ROLLER_COASTER 0, // RIDE_TYPE_MINE_RIDE 0, // RIDE_TYPE_59 diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 2c446e448d..7930b0dcea 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -328,5 +328,6 @@ TRACK_PAINT_FUNCTION get_track_paint_function_magic_carpet(int trackType, int di TRACK_PAINT_FUNCTION get_track_paint_function_submarine_ride(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_river_rafts(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_enterprise(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_inverted_impulse_rc(int trackType, int direction); #endif From e23f01be2698d1b4856c4275110cd0cc1bbebf5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 15:21:18 +0200 Subject: [PATCH 25/55] Add generated Mini RC --- src/ride/coaster/mini_roller_coaster.c | 6179 ++++++++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 6181 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/mini_roller_coaster.c b/src/ride/coaster/mini_roller_coaster.c index 846fd9695d..a31fc84808 100644 --- a/src/ride/coaster/mini_roller_coaster.c +++ b/src/ride/coaster/mini_roller_coaster.c @@ -13,3 +13,6182 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void mini_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19044, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19045, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19046, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19047, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18738, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18739, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void mini_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19056, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19057, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19058, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19059, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18796, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18797, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18798, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18799, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void mini_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18812, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 38, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18813, 0, 0, 32, 1, 98, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 38, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18814, 0, 0, 32, 1, 98, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 38, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18815, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 38, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void mini_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19048, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19049, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19050, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19051, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18788, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18789, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18790, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18791, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void mini_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18800, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 18, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18801, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18804, 0, 0, 32, 1, 66, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 18, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18802, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18805, 0, 0, 32, 1, 66, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 18, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18803, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 18, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void mini_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18806, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 26, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18807, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18810, 0, 0, 32, 1, 66, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 26, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18808, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18811, 0, 0, 32, 1, 66, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 26, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18809, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 26, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void mini_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19052, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19053, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19054, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19055, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18792, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18793, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18794, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18795, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void mini_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18851, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18856, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18861, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18846, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18850, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18855, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18860, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18845, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18849, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18854, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18859, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18844, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18848, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18853, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18858, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18843, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18847, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18852, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18857, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18842, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mini_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mini_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18748, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18756, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18749, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18757, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18750, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18751, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void mini_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18752, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18753, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18754, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18758, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18755, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18759, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void mini_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18754, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18758, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18755, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18759, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18752, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18753, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void mini_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18750, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18751, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18748, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18756, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18749, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18757, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void mini_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18871, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18882, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18876, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18881, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18866, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18870, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18875, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18880, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18865, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18869, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18874, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18879, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18864, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18868, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18873, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18878, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18863, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18867, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18872, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18877, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18883, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18862, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mini_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mini_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18760, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18764, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18761, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18765, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18762, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18763, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void mini_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18766, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18767, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18768, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18770, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18769, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18771, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void mini_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18772, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18776, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18773, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18777, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18774, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18775, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void mini_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18778, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18779, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18780, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18782, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18781, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18783, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void mini_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18784, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18785, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18786, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18787, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void mini_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18936, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18941, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18946, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18951, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18937, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18942, 0, 0, 32, 16, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18947, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18952, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18938, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18943, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18948, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18953, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18939, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18944, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18949, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18954, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18940, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18945, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18950, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18955, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mini_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18916, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18921, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18926, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18931, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18917, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18922, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18927, 0, 0, 32, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18932, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18918, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18923, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18928, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18933, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18919, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18924, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18929, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18934, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18920, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18925, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18930, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18935, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mini_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mini_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void mini_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mini_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mini_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18900, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18904, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18903, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18907, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18901, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(1, 5, 3, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18905, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18902, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18906, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18902, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18906, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18901, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(1, 5, 3, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18905, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18903, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18907, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18900, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18904, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18908, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18912, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18911, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18915, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18909, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18913, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18910, 0, 0, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18914, 0, 0, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18910, 0, 0, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18914, 0, 0, 32, 26, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18909, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18913, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18911, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18915, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18908, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18912, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18821, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18824, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18827, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18818, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18820, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18823, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18826, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18817, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18819, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18822, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18825, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18816, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mini_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mini_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18833, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18840, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18836, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18839, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18830, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18832, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18835, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18838, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18829, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18831, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18834, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18837, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18841, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18828, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mini_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mini_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18967, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18969, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18971, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18965, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18966, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18968, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18970, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18964, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mini_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18956, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18958, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18960, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18962, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18957, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18959, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18961, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(2, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18963, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mini_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mini_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void mini_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mini_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mini_rc_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18991, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18998, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18994, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18997, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18988, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18990, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18993, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18996, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18987, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18989, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18992, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18995, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18999, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18986, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18988, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18991, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18998, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18994, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18997, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18987, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18990, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18993, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18996, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18986, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18989, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18992, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18995, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18999, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18972, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18975, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18978, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18981, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18985, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 11, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18973, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18976, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18979, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18982, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18974, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18977, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18984, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18980, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18983, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18975, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18978, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18981, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18985, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 11, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18972, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18976, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18979, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18982, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18973, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18977, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18984, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18980, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18983, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18974, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mini_rc_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void mini_rc_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mini_rc_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mini_rc_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19031, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19042, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19036, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19041, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19026, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19030, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19035, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19040, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19025, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19029, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19034, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19039, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19024, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19028, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19033, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19038, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19023, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19027, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19032, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19037, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19043, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19022, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19026, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19031, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19042, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19036, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19041, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19025, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19030, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19035, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19040, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19024, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19029, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19034, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19039, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19023, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19028, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19033, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19038, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19022, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19027, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19032, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19037, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19043, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19000, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19005, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19010, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19015, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19021, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19001, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19006, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19011, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19016, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19002, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19007, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19012, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19017, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19003, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19008, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19013, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19018, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19004, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19009, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19020, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19014, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19019, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19005, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19010, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19015, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19021, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19000, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19006, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19011, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19016, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19001, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19007, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19012, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19017, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19002, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19008, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19013, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19018, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19003, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19009, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19020, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19014, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19019, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19004, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mini_rc_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void mini_rc_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mini_rc_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mini_rc_track_left_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18893, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18897, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18894, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18898, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18895, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18899, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18892, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18896, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_left(height - 8, TUNNEL_8); + break; + case 2: + paint_util_push_tunnel_right(height + 56, TUNNEL_7); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_7); + paint_util_push_tunnel_left(height + 56, TUNNEL_7); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void mini_rc_track_right_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18884, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18888, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18885, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18889, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18886, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18890, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18887, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18891, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 56, TUNNEL_7); + paint_util_push_tunnel_left(height - 8, TUNNEL_7); + break; + case 1: + paint_util_push_tunnel_left(height + 56, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_7); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void mini_rc_track_left_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_right_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void mini_rc_track_right_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_left_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mini_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18740, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18741, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void mini_rc_track_25_deg_up_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19222, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19223, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19224, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19225, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void mini_rc_track_25_deg_up_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19226, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19227, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19228, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19229, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void mini_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, 0x20000000 | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(1, 5, 6, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18738, 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(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18739, 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(1, 5, 6, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18738, 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(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18739, 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); + 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); +} + +static void mini_rc_track_25_deg_down_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_25_deg_up_right_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_25_deg_down_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_25_deg_up_left_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19076, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19080, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19084, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19088, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19077, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19081, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19085, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19089, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19078, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19082, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19086, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19090, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19079, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(1, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19083, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(2, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19087, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(1, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19091, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(2, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19060, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19064, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19068, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19072, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19061, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19065, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19069, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19073, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19062, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19066, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19070, 0, 0, 28, 28, 3, height, 4, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19074, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19063, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19067, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19071, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19075, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + mini_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + mini_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void mini_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19108, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19112, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19116, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19120, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19109, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19113, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19117, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19121, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19110, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19114, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19118, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19122, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19111, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(1, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19115, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(2, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19119, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(1, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19123, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(2, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19092, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19096, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19100, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19104, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19093, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19097, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19101, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19105, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19094, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19098, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19102, 0, 0, 28, 28, 0, height, 4, 4, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19106, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19095, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19099, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19103, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19107, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + mini_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + mini_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void mini_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19189, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19127, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19186, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19124, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19188, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19126, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19187, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19125, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19201, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19139, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19198, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19136, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19200, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19138, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19199, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19137, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mini_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19151, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19148, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19150, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 38, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19149, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 42, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 38, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 42, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void mini_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19193, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19131, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19190, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19128, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19192, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19130, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19191, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19129, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mini_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19143, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19140, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19142, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 22, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19141, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 22, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 22, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 22, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mini_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19147, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19144, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19146, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 27, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19145, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(2, 0, 27, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 27, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 27, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mini_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19197, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19135, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19194, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19132, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19196, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19134, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19195, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19133, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mini_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19199, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19137, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19200, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19138, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19198, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19136, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19201, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19139, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mini_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19149, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19150, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19148, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 30, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19151, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 34, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 30, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 34, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void mini_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19195, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19133, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19196, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19134, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19194, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19132, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19197, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19135, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mini_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19145, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19146, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19144, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 23, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19147, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 23, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 23, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 23, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mini_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19141, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19142, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19140, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19143, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mini_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19191, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19129, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19192, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19130, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19190, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19128, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19193, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19131, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mini_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19159, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19156, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19160, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19158, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19157, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19164, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19161, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19163, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19165, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19162, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19162, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19163, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19165, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19161, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19164, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19157, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19158, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19156, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19160, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19159, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19179, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19176, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19180, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19178, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19177, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mini_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19184, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19181, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19183, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19185, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19182, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mini_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19169, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19166, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19170, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19168, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19167, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mini_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19174, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19171, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19173, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19175, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19172, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mini_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19172, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19173, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19175, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19171, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19174, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mini_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19167, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19168, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19166, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19170, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19169, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mini_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19182, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19183, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19185, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19181, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19184, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mini_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19177, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19178, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19176, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19180, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19179, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mini_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19155, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19152, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19154, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19153, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19153, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19154, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19152, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19155, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mini_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18742, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18743, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void mini_rc_track_left_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19317, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19319, 0, 6, 32, 1, 34, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19321, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19315, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19316, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19318, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19320, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19314, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mini_rc_track_right_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19306, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19308, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19310, 0, 6, 32, 1, 34, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19312, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19307, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19309, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19311, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19313, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mini_rc_track_left_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mini_rc_track_right_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void mini_rc_track_right_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mini_rc_track_left_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mini_rc_track_left_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19286, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19291, 0, 0, 32, 1, 34, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19296, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19301, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19287, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19292, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19297, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19302, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19288, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19293, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19298, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19303, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19289, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19294, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19299, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19304, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19290, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19295, 0, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19300, 0, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19305, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mini_rc_track_right_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19266, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19271, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19276, 0, 0, 32, 1, 34, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19281, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19267, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19272, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19277, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19282, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19268, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19273, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19278, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19283, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19269, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19274, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19279, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19284, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19270, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19275, 0, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19280, 0, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19285, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_8); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void mini_rc_track_left_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mini_rc_track_right_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void mini_rc_track_right_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mini_rc_track_left_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mini_rc_track_25_deg_up_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19230, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19231, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19238, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19232, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19233, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void mini_rc_track_25_deg_up_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19234, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19235, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19236, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19239, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19237, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void mini_rc_track_left_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19240, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19241, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19248, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19242, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19243, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void mini_rc_track_right_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19244, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19245, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19246, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19249, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19247, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void mini_rc_track_25_deg_down_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_right_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_25_deg_down_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_left_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_left_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_25_deg_up_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_right_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_25_deg_up_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_left_banked_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19250, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19251, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19252, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19253, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void mini_rc_track_right_banked_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19254, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19255, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19256, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19257, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void mini_rc_track_left_banked_25_deg_up_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19258, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19259, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19260, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19261, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void mini_rc_track_right_banked_25_deg_up_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19262, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19263, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19264, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19265, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void mini_rc_track_left_banked_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_right_banked_25_deg_up_to_right_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_right_banked_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_left_banked_25_deg_up_to_left_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_left_banked_25_deg_down_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_right_banked_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_right_banked_25_deg_down_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_left_banked_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19202, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19203, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19210, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19204, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19205, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void mini_rc_track_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19206, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19207, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19208, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19211, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19209, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void mini_rc_track_left_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19212, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19213, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19220, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19214, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19215, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void mini_rc_track_right_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19216, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19217, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19218, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19221, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19219, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void mini_rc_track_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_right_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_left_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_left_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mini_rc_track_right_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mini_rc_track_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_mini_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return mini_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return mini_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return mini_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return mini_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return mini_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return mini_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return mini_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return mini_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return mini_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return mini_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return mini_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return mini_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return mini_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return mini_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return mini_rc_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return mini_rc_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return mini_rc_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return mini_rc_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return mini_rc_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return mini_rc_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return mini_rc_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return mini_rc_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return mini_rc_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return mini_rc_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return mini_rc_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return mini_rc_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return mini_rc_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return mini_rc_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return mini_rc_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return mini_rc_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return mini_rc_track_right_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: + return mini_rc_track_left_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: + return mini_rc_track_right_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return mini_rc_track_left_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return mini_rc_track_right_quarter_turn_5_25_deg_down; + case TRACK_ELEM_S_BEND_LEFT: + return mini_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return mini_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return mini_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return mini_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return mini_rc_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return mini_rc_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return mini_rc_track_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return mini_rc_track_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return mini_rc_track_left_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return mini_rc_track_right_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: + return mini_rc_track_left_half_banked_helix_up_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: + return mini_rc_track_right_half_banked_helix_up_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: + return mini_rc_track_left_half_banked_helix_down_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: + return mini_rc_track_right_half_banked_helix_down_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: + return mini_rc_track_left_half_banked_helix_up_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: + return mini_rc_track_right_half_banked_helix_up_large; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: + return mini_rc_track_left_half_banked_helix_down_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: + return mini_rc_track_right_half_banked_helix_down_large; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP: + return mini_rc_track_left_quarter_turn_1_60_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP: + return mini_rc_track_right_quarter_turn_1_60_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return mini_rc_track_left_quarter_turn_1_60_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return mini_rc_track_right_quarter_turn_1_60_deg_down; + case TRACK_ELEM_BRAKES: + return mini_rc_track_brakes; + case TRACK_ELEM_25_DEG_UP_LEFT_BANKED: + return mini_rc_track_25_deg_up_left_banked; + case TRACK_ELEM_25_DEG_UP_RIGHT_BANKED: + return mini_rc_track_25_deg_up_right_banked; + case TRACK_ELEM_ON_RIDE_PHOTO: + return mini_rc_track_on_ride_photo; + case TRACK_ELEM_25_DEG_DOWN_LEFT_BANKED: + return mini_rc_track_25_deg_down_left_banked; + case TRACK_ELEM_25_DEG_DOWN_RIGHT_BANKED: + return mini_rc_track_25_deg_down_right_banked; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return mini_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return mini_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return mini_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return mini_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + return mini_rc_track_left_eighth_bank_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + return mini_rc_track_right_eighth_bank_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + return mini_rc_track_left_eighth_bank_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + return mini_rc_track_right_eighth_bank_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return mini_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return mini_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP: + return mini_rc_track_diag_60_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return mini_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + return mini_rc_track_diag_25_deg_up_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + return mini_rc_track_diag_60_deg_up_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return mini_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return mini_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN: + return mini_rc_track_diag_60_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return mini_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + return mini_rc_track_diag_25_deg_down_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + return mini_rc_track_diag_60_deg_down_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return mini_rc_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + return mini_rc_track_diag_flat_to_left_bank; + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + return mini_rc_track_diag_flat_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + return mini_rc_track_diag_left_bank_to_flat; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + return mini_rc_track_diag_right_bank_to_flat; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + return mini_rc_track_diag_left_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + return mini_rc_track_diag_right_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + return mini_rc_track_diag_25_deg_up_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + return mini_rc_track_diag_25_deg_up_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + return mini_rc_track_diag_left_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + return mini_rc_track_diag_right_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + return mini_rc_track_diag_25_deg_down_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + return mini_rc_track_diag_25_deg_down_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK: + return mini_rc_track_diag_left_bank; + case TRACK_ELEM_DIAG_RIGHT_BANK: + return mini_rc_track_diag_right_bank; + case TRACK_ELEM_BLOCK_BRAKES: + return mini_rc_track_block_brakes; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return mini_rc_track_left_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return mini_rc_track_right_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return mini_rc_track_left_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return mini_rc_track_right_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return mini_rc_track_left_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return mini_rc_track_right_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return mini_rc_track_left_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return mini_rc_track_right_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANKED_25_DEG_UP: + return mini_rc_track_25_deg_up_to_left_banked_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANKED_25_DEG_UP: + return mini_rc_track_25_deg_up_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return mini_rc_track_left_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return mini_rc_track_right_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANKED_25_DEG_DOWN: + return mini_rc_track_25_deg_down_to_left_banked_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANKED_25_DEG_DOWN: + return mini_rc_track_25_deg_down_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return mini_rc_track_left_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return mini_rc_track_right_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return mini_rc_track_left_banked_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return mini_rc_track_right_banked_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_LEFT_BANKED_FLAT: + return mini_rc_track_left_banked_25_deg_up_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_RIGHT_BANKED_FLAT: + return mini_rc_track_right_banked_25_deg_up_to_right_banked_flat; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return mini_rc_track_left_banked_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return mini_rc_track_right_banked_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_LEFT_BANKED_FLAT: + return mini_rc_track_left_banked_25_deg_down_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_RIGHT_BANKED_FLAT: + return mini_rc_track_right_banked_25_deg_down_to_right_banked_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return mini_rc_track_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return mini_rc_track_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_FLAT: + return mini_rc_track_left_banked_25_deg_up_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_FLAT: + return mini_rc_track_right_banked_25_deg_up_to_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return mini_rc_track_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return mini_rc_track_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_FLAT: + return mini_rc_track_left_banked_25_deg_down_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_FLAT: + return mini_rc_track_right_banked_25_deg_down_to_flat; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index cc2f470067..edbad94827 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6328,7 +6328,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_shop, // RIDE_TYPE_54 0, // RIDE_TYPE_55 get_track_paint_function_inverted_impulse_rc, // RIDE_TYPE_INVERTED_IMPULSE_COASTER - 0, // RIDE_TYPE_MINI_ROLLER_COASTER + get_track_paint_function_mini_rc, // RIDE_TYPE_MINI_ROLLER_COASTER 0, // RIDE_TYPE_MINE_RIDE 0, // RIDE_TYPE_59 0, // RIDE_TYPE_LIM_LAUNCHED_ROLLER_COASTER diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 7930b0dcea..15c0a87743 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -329,5 +329,6 @@ TRACK_PAINT_FUNCTION get_track_paint_function_submarine_ride(int trackType, int TRACK_PAINT_FUNCTION get_track_paint_function_river_rafts(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_enterprise(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_inverted_impulse_rc(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_mini_rc(int trackType, int direction); #endif From b2c068906db34149de16c282dbbf6570fe93b17c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 15:22:11 +0200 Subject: [PATCH 26/55] Add generated Mine ride --- src/ride/coaster/mine_ride.c | 3679 ++++++++++++++++++++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 3681 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/mine_ride.c b/src/ride/coaster/mine_ride.c index 846fd9695d..258643a9aa 100644 --- a/src/ride/coaster/mine_ride.c +++ b/src/ride/coaster/mine_ride.c @@ -13,3 +13,3682 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void mine_ride_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19338, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19339, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void mine_ride_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19388, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19389, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19390, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19391, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void mine_ride_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19380, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19381, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19382, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19383, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void mine_ride_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19384, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19385, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19386, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19387, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void mine_ride_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_ride_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_ride_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_ride_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_ride_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_ride_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_ride_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19427, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19432, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19437, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19422, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19426, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19431, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19436, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19421, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19425, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19430, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19435, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19420, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19424, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19429, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19434, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19419, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19423, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19428, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19433, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19418, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mine_ride_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mine_ride_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19340, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19348, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19341, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19349, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19342, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19343, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void mine_ride_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19344, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19345, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19346, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19350, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19347, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19351, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void mine_ride_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19346, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19350, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19347, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19351, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19344, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19345, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void mine_ride_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19342, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19343, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19340, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19348, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19341, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19349, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void mine_ride_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19447, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19458, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19452, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19457, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19442, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19446, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19451, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19456, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19441, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19445, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19450, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19455, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19440, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19444, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19449, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19454, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19439, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19443, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19448, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19453, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19459, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19438, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mine_ride_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mine_ride_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19352, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19356, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19353, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19357, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19354, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19355, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void mine_ride_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19358, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19359, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19360, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19362, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19361, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19363, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void mine_ride_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19364, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19368, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19365, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19369, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19366, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19367, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void mine_ride_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19370, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19371, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19372, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19374, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19373, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19375, 0, 0, 32, 1, 34, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void mine_ride_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_ride_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_ride_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_ride_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_ride_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_ride_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_ride_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_ride_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_ride_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19376, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19377, 0, 0, 32, 1, 26, height, 0, 27, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19378, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19379, 0, 0, 32, 20, 3, height, 0, 6, height); + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + break; + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void mine_ride_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + mine_ride_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_ride_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19460, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19464, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19463, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19467, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19461, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(1, 5, 3, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19465, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19462, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19466, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19462, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19466, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19461, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(1, 5, 3, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19465, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19463, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19467, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19460, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19464, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19468, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19472, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19471, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19475, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19469, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19473, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19470, 0, 0, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19474, 0, 0, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19470, 0, 0, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19474, 0, 0, 32, 26, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19469, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19473, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19471, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19475, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19468, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19472, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19397, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19400, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19403, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19394, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19396, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19399, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19402, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19393, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19395, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19398, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19401, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19392, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mine_ride_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mine_ride_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19409, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19416, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19412, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19415, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19406, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19408, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19411, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19414, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19405, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19407, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19410, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19413, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19417, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19404, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mine_ride_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mine_ride_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19495, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19502, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19498, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19501, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19492, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19494, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19497, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19500, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19491, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19493, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19496, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19499, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19503, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19490, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19492, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19495, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19502, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19498, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19501, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19491, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19494, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19497, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19500, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19490, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19493, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19496, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19499, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19503, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19476, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19479, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19482, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19485, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19489, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 11, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19477, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19480, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19483, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19486, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19478, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19481, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19488, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19484, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19487, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19479, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19482, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19485, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19489, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 11, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19476, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19480, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19483, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19486, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19477, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19481, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19488, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19484, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19487, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19478, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mine_ride_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void mine_ride_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + mine_ride_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mine_ride_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19535, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19546, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19540, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19545, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19530, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19534, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19539, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19544, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19529, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19533, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19538, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19543, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19528, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19532, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19537, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19542, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19527, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19531, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19536, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19541, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19547, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19526, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19530, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19535, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19546, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19540, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19545, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19529, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19534, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19539, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19544, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19528, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19533, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19538, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19543, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19527, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19532, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19537, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19542, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19526, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19531, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19536, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19541, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19547, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19504, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19509, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19514, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19519, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19525, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19505, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19510, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19515, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19520, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19506, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19511, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19516, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19521, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19507, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19512, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19517, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19522, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19508, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19513, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19524, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19518, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19523, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_6); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19509, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19514, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19519, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19525, 0, 0, 1, 32, 26, height, 27, 0, height); + metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19504, 0, 0, 20, 32, 3, height, 6, 0, height); + metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_6); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_6); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19510, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19515, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19520, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19505, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19511, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19516, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19521, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19506, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19512, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19517, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19522, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19507, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19513, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19524, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19518, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19523, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19508, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mine_ride_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void mine_ride_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + mine_ride_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void mine_ride_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, 0x20000000 | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(1, 5, 6, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19338, 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(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19339, 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(1, 5, 6, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19338, 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(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19339, 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); + 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); +} + +static void mine_ride_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19564, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19568, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19572, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19576, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19565, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19569, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19573, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19577, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19566, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19570, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19574, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19578, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19567, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(1, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19571, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(2, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19575, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(1, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19579, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(2, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19548, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19552, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19556, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19560, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19549, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19553, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19557, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19561, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19550, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19554, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19558, 0, 0, 28, 28, 3, height, 4, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19562, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19551, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19555, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19559, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19563, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + mine_ride_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_ride_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + mine_ride_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void mine_ride_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19596, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19600, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19604, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19608, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19597, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19601, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19605, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19609, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19598, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19602, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19606, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19610, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19599, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(1, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19603, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(2, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19607, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(1, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19611, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(2, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19580, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19584, 0, 0, 32, 20, 3, height, 0, 6, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19588, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19592, 0, 0, 32, 1, 26, height, 0, 27, height); + metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19581, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19585, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19589, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19593, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19582, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19586, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19590, 0, 0, 28, 28, 0, height, 4, 4, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19594, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19583, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19587, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19591, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19595, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + mine_ride_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void mine_ride_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + mine_ride_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void mine_ride_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19615, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19612, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19614, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19613, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19627, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19624, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19626, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19625, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mine_ride_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19619, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19616, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19618, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19617, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mine_ride_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19623, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19620, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19622, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19621, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mine_ride_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19625, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19626, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19624, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19627, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mine_ride_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19621, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19622, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19620, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19623, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mine_ride_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19617, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19618, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19616, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19619, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mine_ride_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19635, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19632, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19636, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19634, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19633, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19640, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19637, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19639, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19641, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19638, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19638, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19639, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19641, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19637, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19640, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19633, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19634, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19632, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19636, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19635, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19655, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19652, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19656, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19654, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19653, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mine_ride_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19660, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19657, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19659, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19661, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19658, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mine_ride_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19645, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19642, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19646, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19644, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19643, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mine_ride_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19650, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19647, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19649, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19651, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19648, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mine_ride_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19648, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19649, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19651, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19647, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19650, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mine_ride_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19643, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19644, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19642, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19646, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19645, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void mine_ride_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19658, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19659, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19661, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19657, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19660, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mine_ride_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19653, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19654, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19652, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19656, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19655, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void mine_ride_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19631, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19628, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19630, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19629, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void mine_ride_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19629, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19630, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19628, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19631, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +TRACK_PAINT_FUNCTION get_track_paint_function_mine_ride(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return mine_ride_track_flat; + case TRACK_ELEM_25_DEG_UP: + return mine_ride_track_25_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return mine_ride_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return mine_ride_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return mine_ride_track_25_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return mine_ride_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return mine_ride_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return mine_ride_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return mine_ride_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return mine_ride_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return mine_ride_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return mine_ride_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return mine_ride_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return mine_ride_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return mine_ride_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return mine_ride_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return mine_ride_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return mine_ride_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return mine_ride_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return mine_ride_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return mine_ride_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return mine_ride_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return mine_ride_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return mine_ride_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return mine_ride_track_right_bank; + case TRACK_ELEM_S_BEND_LEFT: + return mine_ride_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return mine_ride_track_s_bend_right; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return mine_ride_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return mine_ride_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return mine_ride_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return mine_ride_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: + return mine_ride_track_left_half_banked_helix_up_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: + return mine_ride_track_right_half_banked_helix_up_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: + return mine_ride_track_left_half_banked_helix_down_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: + return mine_ride_track_right_half_banked_helix_down_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: + return mine_ride_track_left_half_banked_helix_up_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: + return mine_ride_track_right_half_banked_helix_up_large; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: + return mine_ride_track_left_half_banked_helix_down_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: + return mine_ride_track_right_half_banked_helix_down_large; + case TRACK_ELEM_ON_RIDE_PHOTO: + return mine_ride_track_on_ride_photo; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return mine_ride_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return mine_ride_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return mine_ride_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return mine_ride_track_right_eighth_to_orthogonal; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + return mine_ride_track_left_eighth_bank_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + return mine_ride_track_right_eighth_bank_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + return mine_ride_track_left_eighth_bank_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + return mine_ride_track_right_eighth_bank_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return mine_ride_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return mine_ride_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return mine_ride_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return mine_ride_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return mine_ride_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return mine_ride_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return mine_ride_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + return mine_ride_track_diag_flat_to_left_bank; + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + return mine_ride_track_diag_flat_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + return mine_ride_track_diag_left_bank_to_flat; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + return mine_ride_track_diag_right_bank_to_flat; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + return mine_ride_track_diag_left_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + return mine_ride_track_diag_right_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + return mine_ride_track_diag_25_deg_up_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + return mine_ride_track_diag_25_deg_up_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + return mine_ride_track_diag_left_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + return mine_ride_track_diag_right_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + return mine_ride_track_diag_25_deg_down_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + return mine_ride_track_diag_25_deg_down_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK: + return mine_ride_track_diag_left_bank; + case TRACK_ELEM_DIAG_RIGHT_BANK: + return mine_ride_track_diag_right_bank; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index edbad94827..5904692d71 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6329,7 +6329,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { 0, // RIDE_TYPE_55 get_track_paint_function_inverted_impulse_rc, // RIDE_TYPE_INVERTED_IMPULSE_COASTER get_track_paint_function_mini_rc, // RIDE_TYPE_MINI_ROLLER_COASTER - 0, // RIDE_TYPE_MINE_RIDE + get_track_paint_function_mine_ride, // RIDE_TYPE_MINE_RIDE 0, // RIDE_TYPE_59 0, // RIDE_TYPE_LIM_LAUNCHED_ROLLER_COASTER }; diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 15c0a87743..dd2fd7c50b 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -330,5 +330,6 @@ TRACK_PAINT_FUNCTION get_track_paint_function_river_rafts(int trackType, int dir TRACK_PAINT_FUNCTION get_track_paint_function_enterprise(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_inverted_impulse_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_mini_rc(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_mine_ride(int trackType, int direction); #endif From 04782c257ff5b62010f4af72deb751674fcf221d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 9 Oct 2016 15:23:04 +0200 Subject: [PATCH 27/55] Add generated LIM launched RC --- .../coaster/lim_launched_roller_coaster.c | 7191 +++++++++++++++++ src/ride/track_data.c | 2 +- src/ride/track_paint.h | 1 + 3 files changed, 7193 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/lim_launched_roller_coaster.c b/src/ride/coaster/lim_launched_roller_coaster.c index 846fd9695d..7dba41102a 100644 --- a/src/ride/coaster/lim_launched_roller_coaster.c +++ b/src/ride/coaster/lim_launched_roller_coaster.c @@ -13,3 +13,7194 @@ * A full copy of the GNU General Public License can be found in licence.txt *****************************************************************************/ #pragma endregion + +#include "../../drawing/drawing.h" +#include "../../paint/supports.h" +#include "../../interface/viewport.h" +#include "../../paint/map_element/map_element.h" +#include "../../paint/paint.h" +#include "../../sprites.h" +#include "../../world/map.h" +#include "../../world/sprite.h" +#include "../ride_data.h" +#include "../track_data.h" +#include "../track_paint.h" + +static void lim_launched_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15006, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15007, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15008, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15009, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15004, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15005, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void lim_launched_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15060, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15061, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15062, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15063, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15032, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15033, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15034, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15035, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void lim_launched_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15076, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15077, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15078, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15079, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15048, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15049, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15050, 0, 0, 32, 1, 98, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15051, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void lim_launched_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15052, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15053, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15054, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15055, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15024, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15025, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15026, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15027, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void lim_launched_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15064, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15065, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15068, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15066, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15069, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15067, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15036, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15037, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15040, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15038, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15041, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15039, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void lim_launched_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15070, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15071, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15074, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15072, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15075, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15073, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15042, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15043, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15046, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15044, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15047, 0, 0, 32, 1, 66, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15045, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); +} + +static void lim_launched_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15056, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15057, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15058, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15059, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15028, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15029, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15030, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15031, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void lim_launched_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15183, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15188, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15193, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15178, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15182, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15187, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15192, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15177, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15181, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15186, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15191, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15176, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15180, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15185, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15190, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15175, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15179, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15184, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15189, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15174, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + lim_launched_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15080, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15092, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15081, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15093, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15082, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15083, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void lim_launched_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15084, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15085, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15086, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15094, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15087, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15095, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void lim_launched_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15086, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15094, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15087, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15095, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15084, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15085, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void lim_launched_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15082, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15083, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15080, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15092, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15081, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15093, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void lim_launched_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15203, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15214, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15208, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15213, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15198, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15202, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15207, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15212, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15197, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15201, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15206, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15211, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15196, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15200, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15205, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15210, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15195, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15199, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15204, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15209, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15215, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15194, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + lim_launched_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15096, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15112, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15097, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15113, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15098, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15099, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void lim_launched_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15100, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15101, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15102, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15114, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15103, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15115, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void lim_launched_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15104, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15116, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15105, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15117, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15106, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15107, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void lim_launched_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15108, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15109, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15110, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15118, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15111, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15119, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void lim_launched_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15088, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15089, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15090, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15091, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void lim_launched_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15296, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15301, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15306, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15311, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15297, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15302, 0, 0, 32, 16, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15307, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15312, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15298, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15303, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15308, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15313, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15299, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15304, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15309, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15314, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15300, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15305, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15310, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15315, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lim_launched_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15276, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15281, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15286, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15291, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15277, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15282, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15287, 0, 0, 32, 16, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15292, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15278, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15283, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15288, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15293, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15279, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15284, 0, 0, 16, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15289, 0, 0, 16, 32, 3, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15294, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15280, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15285, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15290, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15295, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lim_launched_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + lim_launched_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + lim_launched_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15260, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15264, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15263, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15267, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15261, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15265, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15262, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15266, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15262, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15266, 0, 0, 32, 26, 3, height, 0, 6, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15261, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15265, 0, 0, 32, 26, 3, height); + metal_a_supports_paint_setup(0, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15263, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15267, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15260, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15264, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15268, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15272, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15271, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15275, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15269, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15273, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15270, 0, 0, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15274, 0, 0, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15270, 0, 0, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15274, 0, 0, 32, 26, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15269, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15273, 0, 0, 32, 26, 3, height, 0, 6, height); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15271, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15275, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15268, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15272, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_left_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15388, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15396, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15395, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15403, 0, 6, 32, 20, 7, height); + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15389, 0, 0, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15397, 0, 14, 32, 2, 63, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15394, 0, 6, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15402, 0, 6, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15390, 16, 0, 3, 16, 119, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15398, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15393, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15401, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15391, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15399, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15392, 0, 16, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15400, 0, 16, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15392, 0, 16, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15400, 0, 16, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15391, 0, 0, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15399, 0, 0, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15393, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15401, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15390, 16, 0, 3, 16, 119, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15398, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15394, 0, 6, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15402, 0, 6, 32, 26, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15389, 0, 0, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15397, 0, 14, 32, 2, 63, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15395, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15403, 0, 6, 32, 20, 7, height); + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15388, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15396, 0, 6, 32, 20, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lim_launched_rc_track_right_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15419, 0, 6, 32, 20, 7, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15411, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15412, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15404, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15418, 0, 6, 32, 26, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15410, 0, 6, 32, 26, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15413, 0, 14, 32, 2, 63, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15405, 0, 0, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15417, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15409, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15414, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15406, 16, 0, 2, 16, 119, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15416, 0, 16, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15408, 0, 16, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15415, 0, 0, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15407, 0, 0, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15415, 0, 0, 32, 16, 3, height + 32); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15407, 0, 0, 32, 16, 3, height + 32); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15416, 0, 16, 32, 16, 3, height + 32); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15408, 0, 16, 32, 16, 3, height + 32); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15414, 12, 0, 3, 16, 119, height, 12, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15406, 16, 0, 2, 16, 119, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15417, 16, 16, 2, 16, 119, height, 16, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15409, 10, 16, 4, 16, 119, height, 10, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 168, 0x20); + break; + case 8: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15413, 0, 14, 32, 2, 63, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15405, 0, 0, 32, 26, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15418, 0, 6, 32, 26, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15410, 0, 6, 32, 26, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15412, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15404, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15419, 0, 6, 32, 20, 7, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15411, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + break; + case 2: + paint_util_push_tunnel_left(height - 8, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lim_launched_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15125, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15128, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15131, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15122, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15124, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15127, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15130, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15121, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15123, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15126, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15129, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15120, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + lim_launched_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15137, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15144, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15140, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15143, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15134, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15136, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15139, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15142, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15133, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15135, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15138, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15141, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15145, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15132, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + lim_launched_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15327, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15329, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15331, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15325, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15326, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15328, 6, 0, 20, 32, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15330, 6, 0, 20, 32, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15324, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lim_launched_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15316, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15318, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15320, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15322, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15317, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15319, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15321, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15323, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lim_launched_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + lim_launched_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + lim_launched_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_twist_down_to_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15758, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15782, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15761, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15785, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15764, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15788, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15767, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15791, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15759, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15783, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15762, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15786, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15765, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15789, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15768, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15792, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15760, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15784, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15763, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15787, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15766, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15790, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15769, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15793, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height - 32, TUNNEL_3); + break; + case 2: + paint_util_push_tunnel_left(height - 32, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height, 0x20); + break; + } +} + +static void lim_launched_rc_track_right_twist_down_to_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15770, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15794, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15773, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15797, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15776, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15800, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15779, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15803, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15771, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15795, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15774, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15798, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15777, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15801, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15780, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15804, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15772, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15796, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15775, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15799, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15778, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15802, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15781, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15805, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height + 32, TUNNEL_3); + break; + case 2: + paint_util_push_tunnel_left(height + 32, TUNNEL_3); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height, 0x20); + break; + } +} + +static void lim_launched_rc_track_left_twist_up_to_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15766, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15790, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15769, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15793, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15760, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15784, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15763, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15787, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 32, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15765, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15789, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15768, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15792, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15759, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15783, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15762, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15786, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15764, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15788, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15767, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15791, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15758, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15782, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15761, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15785, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_right_twist_up_to_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15778, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15802, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15781, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15805, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15772, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15796, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15775, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15799, 0, 0, 32, 20, 0, height, 0, 6, height + 44); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 32, TUNNEL_3); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15777, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15801, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15780, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15804, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15771, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15795, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15774, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15798, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15776, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15800, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15779, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15803, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15770, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15794, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15773, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15797, 0, 0, 32, 20, 0, height, 0, 6, height + 28); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 1: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 2: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_left_corkscrew_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15734, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15737, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15740, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15743, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15735, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15738, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15741, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15744, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15736, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15739, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15742, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15745, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 35, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lim_launched_rc_track_right_corkscrew_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15746, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15749, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15752, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15755, 0, 0, 32, 20, 3, height, 0, 6, height + 4); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15747, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15750, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15753, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15756, 0, 0, 20, 20, 3, height, 6, 6, height + 10); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15748, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15751, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15754, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15757, 0, 0, 20, 32, 3, height, 6, 0, height + 24); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height + 35, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lim_launched_rc_track_left_corkscrew_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_right_corkscrew_up(rideIndex, 2 - trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_right_corkscrew_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_left_corkscrew_up(rideIndex, 2 - trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15165, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15172, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15168, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15171, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15162, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15164, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15167, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15170, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15161, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15163, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15166, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15169, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15173, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15160, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15162, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15165, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15172, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15168, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15171, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15161, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15164, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15167, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15170, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15160, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15163, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15166, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15169, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15173, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15146, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15149, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15152, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15155, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15159, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15147, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15150, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15153, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15156, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15148, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15151, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15158, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15154, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15157, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15149, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15152, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15155, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15159, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15146, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15150, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15153, 0, 0, 16, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15156, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15147, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15151, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15158, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15154, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15157, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15148, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + lim_launched_rc_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 4) { + trackSequence -= 4; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + lim_launched_rc_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15247, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15258, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15252, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15257, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15242, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15246, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15251, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15256, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15241, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15245, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15250, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15255, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15240, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15244, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15249, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15254, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15239, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15243, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15248, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15253, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15259, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15238, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15242, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15247, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15258, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15252, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15257, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15241, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15246, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15251, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15256, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15240, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15245, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15250, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15255, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15239, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15244, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15249, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15254, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15238, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15243, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15248, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15253, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15259, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15216, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15221, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15226, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15231, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15237, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15217, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15222, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15227, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15232, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15218, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15223, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15228, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15233, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15219, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15224, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15229, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15234, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15220, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15225, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15236, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15230, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15235, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_0); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 7: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15221, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15226, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15231, 0, 0, 20, 32, 3, height, 6, 0, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15237, 0, 0, 1, 32, 26, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15216, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height, TUNNEL_0); + break; + case 3: + paint_util_push_tunnel_left(height, TUNNEL_0); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 8: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 9: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15222, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15227, 0, 0, 16, 32, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15232, 0, 0, 16, 32, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15217, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 10: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15223, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15228, 0, 0, 16, 16, 1, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15233, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15218, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 11: + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 12: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15224, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15229, 0, 0, 32, 16, 1, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15234, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15219, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 13: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15225, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15236, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15230, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15235, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15220, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction - 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + lim_launched_rc_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + if (trackSequence >= 7) { + trackSequence -= 7; + direction = (direction + 1) & 3; + } + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + lim_launched_rc_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15341, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15345, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15342, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15346, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15343, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15347, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15340, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15344, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_left(height - 8, TUNNEL_2); + break; + case 2: + paint_util_push_tunnel_right(height + 56, TUNNEL_1); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + paint_util_push_tunnel_left(height + 56, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void lim_launched_rc_track_right_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15332, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15336, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15333, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15337, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15334, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15338, 0, 0, 2, 28, 59, height, 28, 2, height + 2); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15335, 0, 0, 28, 28, 3, height, 2, 2, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15339, 0, 0, 28, 28, 1, height, 2, 2, height + 99); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 56, TUNNEL_1); + paint_util_push_tunnel_left(height - 8, TUNNEL_1); + break; + case 1: + paint_util_push_tunnel_left(height + 56, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_right(height - 8, TUNNEL_1); + break; + } + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); +} + +static void lim_launched_rc_track_left_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_right_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_right_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_left_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15018, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15019, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void lim_launched_rc_track_25_deg_up_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15594, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15595, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15596, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15597, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void lim_launched_rc_track_25_deg_up_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15598, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15599, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15600, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15601, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void lim_launched_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15004, 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, gTrackColours[SCHEME_MISC] | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15005, 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, gTrackColours[SCHEME_MISC] | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15004, 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, gTrackColours[SCHEME_MISC] | 22432, 0, 0, 32, 32, 1, height); + metal_a_supports_paint_setup(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); + metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15005, 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); + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void lim_launched_rc_track_25_deg_down_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_25_deg_up_right_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_25_deg_down_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_25_deg_up_left_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15702, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15703, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15704, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15705, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + } + paint_util_set_vertical_tunnel(height + 32); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + break; + } +} + +static void lim_launched_rc_track_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_90_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_60_deg_up_to_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15694, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15695, 0, 0, 2, 20, 55, height, 24, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15696, 0, 0, 2, 20, 55, height, 24, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15697, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_vertical_tunnel(height + 48); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + break; + } +} + +static void lim_launched_rc_track_90_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_60_deg_up_to_90_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_90_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15698, 0, 0, 6, 20, 3, height, 0, 6, height + 2); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15699, 0, 0, 2, 20, 31, height, 39, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15700, 0, 0, 2, 20, 31, height, 39, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15701, 0, 0, 6, 20, 3, height, 0, 6, height + 2); + break; + } + switch (direction) { + case 1: + paint_util_push_tunnel_right(height + 48, TUNNEL_2); + break; + case 2: + paint_util_push_tunnel_left(height + 48, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); +} + +static void lim_launched_rc_track_60_deg_down_to_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15700, 0, 0, 2, 20, 31, height, 39, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15701, 0, 0, 6, 20, 3, height, 0, 6, height + 2); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15698, 0, 0, 6, 20, 3, height, 0, 6, height + 2); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15699, 0, 0, 2, 20, 31, height, 39, 6, height + 8); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 48, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 80, 0x20); + break; + case 1: + break; + } +} + +static void lim_launched_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15526, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15530, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15534, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15538, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15527, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15531, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15535, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15539, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15528, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15532, 0, 0, 16, 16, 3, height, 16, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15536, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15540, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15529, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15533, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15537, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15541, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15510, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15514, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15518, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15522, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15511, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15515, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15519, 0, 0, 34, 16, 3, height, 0, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15523, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15512, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15516, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15520, 0, 0, 28, 28, 3, height, 4, 4, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15524, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15513, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15517, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15521, 0, 0, 16, 18, 3, height, 0, 16, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15525, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + lim_launched_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + lim_launched_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15558, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15562, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15566, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15570, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15559, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15563, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15567, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15571, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15560, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15564, 0, 0, 16, 16, 0, height, 16, 16, height + 27); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15568, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15572, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15561, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15565, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15569, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15573, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15542, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15546, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15550, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15554, 0, 0, 32, 1, 26, height, 0, 27, height); + break; + } + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15543, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15547, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15551, 0, 0, 34, 16, 0, height, 0, 0, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15555, 0, 0, 32, 16, 3, height, 0, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15544, 0, 0, 16, 16, 3, height, 0, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15548, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15552, 0, 0, 28, 28, 0, height, 4, 4, height + 27); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15556, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 4: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15545, 0, 0, 16, 16, 3, height, 16, 0, height); + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15549, 0, 0, 16, 16, 3, height, 0, 0, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15553, 0, 0, 16, 18, 0, height, 0, 16, height + 27); + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15557, 0, 0, 16, 16, 3, height, 16, 16, height); + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + lim_launched_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + lim_launched_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); +} + +static void lim_launched_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15451, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15423, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15448, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15420, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15450, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15422, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15449, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15421, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15463, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15435, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15460, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15432, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15462, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15434, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15461, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15433, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15475, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15447, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15472, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15444, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15474, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15446, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15473, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15445, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15455, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15427, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15452, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15424, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15454, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15426, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15453, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15425, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15467, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15439, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15464, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15436, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15466, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15438, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15465, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15437, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15471, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15443, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15468, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15440, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15470, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15442, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15469, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(0, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15441, -16, -16, 16, 16, 3, height, 0, 0, height); + metal_b_supports_paint_setup(0, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15459, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15431, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15456, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15428, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15458, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15430, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15457, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15429, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15461, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15433, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15462, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15434, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15460, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15432, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15463, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15435, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15473, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15445, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15474, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15446, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15472, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15444, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15475, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15447, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 104, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15457, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15429, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15458, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15430, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15456, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15428, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15459, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15431, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15469, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15441, -16, -16, 16, 16, 3, height, 0, 0, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15470, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15442, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15468, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15440, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15471, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15443, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15465, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15437, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15466, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15438, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15464, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15436, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15467, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15439, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15453, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15425, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15454, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15426, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15452, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } else { + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15424, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + if (track_element_is_lift_hill(mapElement)) { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15455, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } else { + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15427, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15503, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15500, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15504, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15502, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15501, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15508, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15505, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15507, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15509, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15506, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15506, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15507, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15509, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15505, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15508, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15501, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15502, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15500, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15504, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15503, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15493, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15490, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15494, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15492, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15491, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15498, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15495, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15497, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15499, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15496, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15483, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15480, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15484, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15482, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15481, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15488, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15485, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15487, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15489, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15486, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15486, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15487, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15489, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15485, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15488, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15481, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15482, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15480, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15484, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15483, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15496, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15497, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15499, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15495, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15498, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15491, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15492, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15490, -16, -16, 32, 32, 3, height, -16, -16, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15494, -16, -16, 32, 32, 0, height, -16, -16, height + 35); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15493, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15479, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15476, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15478, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15477, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15477, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15478, -16, -16, 32, 32, 3, height, -16, -16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 2: + switch (direction) { + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15476, -16, -16, 32, 32, 0, height, -16, -16, height + 27); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + case 3: + switch (direction) { + case 0: + metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15479, -16, -16, 32, 32, 3, height, -16, -16, height); + metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); + break; + } +} + +static void lim_launched_rc_track_90_deg_to_inverted_flat_quarter_loop_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15722, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15725, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15728, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15731, 0, 0, 2, 20, 31, height, 4, 6, height + 8); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 88, 0x20); + break; + case 1: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15723, 0, 0, 2, 20, 31, height, -8, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15726, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15729, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15732, 0, 0, 2, 20, 31, height, -8, 6, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15724, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15727, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15730, 0, 0, 2, 20, 31, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15733, 0, 0, 32, 20, 3, height, 0, 6, height + 24); + break; + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height + 16, TUNNEL_0); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); + break; + } +} + +static void lim_launched_rc_track_inverted_flat_to_90_deg_quarter_loop_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_90_deg_to_inverted_flat_quarter_loop_up(rideIndex, 2 - trackSequence, direction, height, mapElement); +} + +static void lim_launched_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15020, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15021, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); + } + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 32, 0x20); +} + +static void lim_launched_rc_track_left_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15689, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15691, 0, 6, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15693, 0, 6, 32, 20, 3, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15687, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15688, 6, 0, 20, 32, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15690, 6, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15692, 6, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15686, 6, 0, 20, 32, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lim_launched_rc_track_right_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15678, 0, 6, 32, 20, 3, height); + break; + case 1: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15680, 0, 6, 32, 20, 3, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15682, 0, 6, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15684, 0, 6, 32, 20, 3, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 2: + paint_util_set_general_support_height(height + 56, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15679, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15681, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15683, 6, 0, 1, 32, 34, height, 27, 0, height); + metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15685, 6, 0, 20, 32, 3, height); + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + break; + } + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lim_launched_rc_track_left_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + lim_launched_rc_track_right_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_right_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + lim_launched_rc_track_left_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15658, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15663, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15668, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15673, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15659, 0, 0, 32, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15664, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15669, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15674, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15660, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15665, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15670, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15675, 0, 0, 16, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15661, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15666, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15671, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15676, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15662, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15667, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15672, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15677, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 2: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 3: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lim_launched_rc_track_right_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15638, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15643, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15648, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15653, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 1: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 2: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15639, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15644, 0, 0, 32, 16, 3, height, 0, 16, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15649, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15654, 0, 0, 32, 16, 3, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 3: + switch (direction) { + case 0: + sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15640, 0, 0, 16, 16, 3, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15645, 0, 0, 16, 16, 3, height, 16, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15650, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15655, 0, 0, 16, 16, 3, height, 0, 16, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 64, 0x20); + break; + case 4: + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 5: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15641, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15646, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15651, 0, 0, 1, 1, 34, height, 30, 30, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15656, 0, 0, 16, 32, 3, height, 16, 0, height); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + case 6: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15642, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15647, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15652, 0, 0, 1, 32, 34, height, 27, 0, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15657, 0, 0, 20, 32, 3, height, 6, 0, height); + break; + } + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + switch (direction) { + case 0: + paint_util_push_tunnel_right(height + 8, TUNNEL_2); + break; + case 1: + paint_util_push_tunnel_left(height + 8, TUNNEL_2); + break; + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 72, 0x20); + break; + } +} + +static void lim_launched_rc_track_left_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + lim_launched_rc_track_right_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_right_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + lim_launched_rc_track_left_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_25_deg_up_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15602, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15603, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15610, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15604, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15605, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void lim_launched_rc_track_25_deg_up_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15606, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15607, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15608, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15611, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15609, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void lim_launched_rc_track_left_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15612, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15613, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15620, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15614, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15615, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void lim_launched_rc_track_right_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15616, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15617, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15618, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15621, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15619, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 56, 0x20); +} + +static void lim_launched_rc_track_25_deg_down_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_right_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_25_deg_down_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_left_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_25_deg_up_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_right_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_25_deg_up_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_banked_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15622, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15623, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15624, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15625, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void lim_launched_rc_track_right_banked_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15626, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15627, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15628, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15629, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void lim_launched_rc_track_left_banked_25_deg_up_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15630, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15631, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15632, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15633, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void lim_launched_rc_track_right_banked_25_deg_up_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15634, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15635, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15636, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15637, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void lim_launched_rc_track_left_banked_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_right_banked_25_deg_up_to_right_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_right_banked_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_left_banked_25_deg_up_to_left_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_banked_25_deg_down_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_right_banked_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_right_banked_25_deg_down_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_left_banked_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15574, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15575, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15582, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15576, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15577, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void lim_launched_rc_track_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15578, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15579, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15580, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15583, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15581, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + +static void lim_launched_rc_track_left_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15584, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15585, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15592, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15586, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15587, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void lim_launched_rc_track_right_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15588, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15589, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15590, 0, 0, 32, 20, 3, height, 0, 6, height); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15593, 0, 0, 32, 1, 34, height, 0, 27, height); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15591, 0, 0, 32, 20, 3, height, 0, 6, height); + break; + } + if (track_paint_util_should_paint_supports(gPaintMapPosition)) { + metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); + } + if (direction == 0 || direction == 3) { + paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); + } else { + paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); + } + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 40, 0x20); +} + +static void lim_launched_rc_track_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_right_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_left_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_right_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); +} + +static void lim_launched_rc_track_left_quarter_turn_1_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15706, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15707, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15715, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15716, 0, 0, 2, 2, 63, height, 24, 24, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15709, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15717, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + } + paint_util_set_vertical_tunnel(height + 96); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 96, 0x20); + break; + case 1: + break; + } +} + +static void lim_launched_rc_track_right_quarter_turn_1_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + switch (trackSequence) { + case 0: + switch (direction) { + case 0: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15710, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15718, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 1: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15719, 0, 0, 2, 2, 63, height, 24, 24, height + 8); + break; + case 2: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15712, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15720, 0, 0, 2, 20, 63, height, 24, 6, height + 8); + break; + case 3: + sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15713, 0, 0, 2, 20, 63, height, 4, 6, height + 8); + break; + } + paint_util_set_vertical_tunnel(height + 96); + paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + paint_util_set_general_support_height(height + 96, 0x20); + break; + case 1: + break; + } +} + +static void lim_launched_rc_track_left_quarter_turn_1_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_right_quarter_turn_1_90_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); +} + +static void lim_launched_rc_track_right_quarter_turn_1_90_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + lim_launched_rc_track_left_quarter_turn_1_90_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); +} + +TRACK_PAINT_FUNCTION get_track_paint_function_lim_launched_rc(int trackType, int direction) +{ + switch (trackType) { + case TRACK_ELEM_FLAT: + return lim_launched_rc_track_flat; + case TRACK_ELEM_25_DEG_UP: + return lim_launched_rc_track_25_deg_up; + case TRACK_ELEM_60_DEG_UP: + return lim_launched_rc_track_60_deg_up; + case TRACK_ELEM_FLAT_TO_25_DEG_UP: + return lim_launched_rc_track_flat_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + return lim_launched_rc_track_25_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + return lim_launched_rc_track_60_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_FLAT: + return lim_launched_rc_track_25_deg_up_to_flat; + case TRACK_ELEM_25_DEG_DOWN: + return lim_launched_rc_track_25_deg_down; + case TRACK_ELEM_60_DEG_DOWN: + return lim_launched_rc_track_60_deg_down; + case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: + return lim_launched_rc_track_flat_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + return lim_launched_rc_track_25_deg_down_to_60_deg_down; + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + return lim_launched_rc_track_60_deg_down_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: + return lim_launched_rc_track_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: + return lim_launched_rc_track_left_quarter_turn_5; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: + return lim_launched_rc_track_right_quarter_turn_5; + case TRACK_ELEM_FLAT_TO_LEFT_BANK: + return lim_launched_rc_track_flat_to_left_bank; + case TRACK_ELEM_FLAT_TO_RIGHT_BANK: + return lim_launched_rc_track_flat_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_FLAT: + return lim_launched_rc_track_left_bank_to_flat; + case TRACK_ELEM_RIGHT_BANK_TO_FLAT: + return lim_launched_rc_track_right_bank_to_flat; + case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: + return lim_launched_rc_track_banked_left_quarter_turn_5; + case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: + return lim_launched_rc_track_banked_right_quarter_turn_5; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: + return lim_launched_rc_track_left_bank_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: + return lim_launched_rc_track_right_bank_to_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: + return lim_launched_rc_track_25_deg_up_to_left_bank; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: + return lim_launched_rc_track_25_deg_up_to_right_bank; + case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: + return lim_launched_rc_track_left_bank_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: + return lim_launched_rc_track_right_bank_to_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: + return lim_launched_rc_track_25_deg_down_to_left_bank; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: + return lim_launched_rc_track_25_deg_down_to_right_bank; + case TRACK_ELEM_LEFT_BANK: + return lim_launched_rc_track_left_bank; + case TRACK_ELEM_RIGHT_BANK: + return lim_launched_rc_track_right_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: + return lim_launched_rc_track_left_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: + return lim_launched_rc_track_right_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return lim_launched_rc_track_left_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: + return lim_launched_rc_track_right_quarter_turn_5_25_deg_down; + case TRACK_ELEM_S_BEND_LEFT: + return lim_launched_rc_track_s_bend_left; + case TRACK_ELEM_S_BEND_RIGHT: + return lim_launched_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_VERTICAL_LOOP: + return lim_launched_rc_track_left_vertical_loop; + case TRACK_ELEM_RIGHT_VERTICAL_LOOP: + return lim_launched_rc_track_right_vertical_loop; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + return lim_launched_rc_track_left_quarter_turn_3; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + return lim_launched_rc_track_right_quarter_turn_3; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + return lim_launched_rc_track_left_quarter_turn_3_bank; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + return lim_launched_rc_track_right_quarter_turn_3_bank; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + return lim_launched_rc_track_left_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + return lim_launched_rc_track_right_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return lim_launched_rc_track_left_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + return lim_launched_rc_track_right_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_TWIST_DOWN_TO_UP: + return lim_launched_rc_track_left_twist_down_to_up; + case TRACK_ELEM_RIGHT_TWIST_DOWN_TO_UP: + return lim_launched_rc_track_right_twist_down_to_up; + case TRACK_ELEM_LEFT_TWIST_UP_TO_DOWN: + return lim_launched_rc_track_left_twist_up_to_down; + case TRACK_ELEM_RIGHT_TWIST_UP_TO_DOWN: + return lim_launched_rc_track_right_twist_up_to_down; + case TRACK_ELEM_LEFT_CORKSCREW_UP: + return lim_launched_rc_track_left_corkscrew_up; + case TRACK_ELEM_RIGHT_CORKSCREW_UP: + return lim_launched_rc_track_right_corkscrew_up; + case TRACK_ELEM_LEFT_CORKSCREW_DOWN: + return lim_launched_rc_track_left_corkscrew_down; + case TRACK_ELEM_RIGHT_CORKSCREW_DOWN: + return lim_launched_rc_track_right_corkscrew_down; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: + return lim_launched_rc_track_left_half_banked_helix_up_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: + return lim_launched_rc_track_right_half_banked_helix_up_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: + return lim_launched_rc_track_left_half_banked_helix_down_small; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: + return lim_launched_rc_track_right_half_banked_helix_down_small; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: + return lim_launched_rc_track_left_half_banked_helix_up_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: + return lim_launched_rc_track_right_half_banked_helix_up_large; + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: + return lim_launched_rc_track_left_half_banked_helix_down_large; + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: + return lim_launched_rc_track_right_half_banked_helix_down_large; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP: + return lim_launched_rc_track_left_quarter_turn_1_60_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP: + return lim_launched_rc_track_right_quarter_turn_1_60_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return lim_launched_rc_track_left_quarter_turn_1_60_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + return lim_launched_rc_track_right_quarter_turn_1_60_deg_down; + case TRACK_ELEM_BRAKES: + return lim_launched_rc_track_brakes; + case TRACK_ELEM_25_DEG_UP_LEFT_BANKED: + return lim_launched_rc_track_25_deg_up_left_banked; + case TRACK_ELEM_25_DEG_UP_RIGHT_BANKED: + return lim_launched_rc_track_25_deg_up_right_banked; + case TRACK_ELEM_ON_RIDE_PHOTO: + return lim_launched_rc_track_on_ride_photo; + case TRACK_ELEM_25_DEG_DOWN_LEFT_BANKED: + return lim_launched_rc_track_25_deg_down_left_banked; + case TRACK_ELEM_25_DEG_DOWN_RIGHT_BANKED: + return lim_launched_rc_track_25_deg_down_right_banked; + case TRACK_ELEM_90_DEG_UP: + return lim_launched_rc_track_90_deg_up; + case TRACK_ELEM_90_DEG_DOWN: + return lim_launched_rc_track_90_deg_down; + case TRACK_ELEM_60_DEG_UP_TO_90_DEG_UP: + return lim_launched_rc_track_60_deg_up_to_90_deg_up; + case TRACK_ELEM_90_DEG_DOWN_TO_60_DEG_DOWN: + return lim_launched_rc_track_90_deg_down_to_60_deg_down; + case TRACK_ELEM_90_DEG_UP_TO_60_DEG_UP: + return lim_launched_rc_track_90_deg_up_to_60_deg_up; + case TRACK_ELEM_60_DEG_DOWN_TO_90_DEG_DOWN: + return lim_launched_rc_track_60_deg_down_to_90_deg_down; + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + return lim_launched_rc_track_left_eighth_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + return lim_launched_rc_track_right_eighth_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + return lim_launched_rc_track_left_eighth_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + return lim_launched_rc_track_right_eighth_to_orthogonal; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + return lim_launched_rc_track_left_eighth_bank_to_diag; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + return lim_launched_rc_track_right_eighth_bank_to_diag; + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + return lim_launched_rc_track_left_eighth_bank_to_orthogonal; + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + return lim_launched_rc_track_right_eighth_bank_to_orthogonal; + case TRACK_ELEM_DIAG_FLAT: + return lim_launched_rc_track_diag_flat; + case TRACK_ELEM_DIAG_25_DEG_UP: + return lim_launched_rc_track_diag_25_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP: + return lim_launched_rc_track_diag_60_deg_up; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + return lim_launched_rc_track_diag_flat_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + return lim_launched_rc_track_diag_25_deg_up_to_60_deg_up; + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + return lim_launched_rc_track_diag_60_deg_up_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + return lim_launched_rc_track_diag_25_deg_up_to_flat; + case TRACK_ELEM_DIAG_25_DEG_DOWN: + return lim_launched_rc_track_diag_25_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN: + return lim_launched_rc_track_diag_60_deg_down; + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + return lim_launched_rc_track_diag_flat_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + return lim_launched_rc_track_diag_25_deg_down_to_60_deg_down; + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + return lim_launched_rc_track_diag_60_deg_down_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + return lim_launched_rc_track_diag_25_deg_down_to_flat; + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + return lim_launched_rc_track_diag_flat_to_left_bank; + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + return lim_launched_rc_track_diag_flat_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + return lim_launched_rc_track_diag_left_bank_to_flat; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + return lim_launched_rc_track_diag_right_bank_to_flat; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + return lim_launched_rc_track_diag_left_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + return lim_launched_rc_track_diag_right_bank_to_25_deg_up; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + return lim_launched_rc_track_diag_25_deg_up_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + return lim_launched_rc_track_diag_25_deg_up_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + return lim_launched_rc_track_diag_left_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + return lim_launched_rc_track_diag_right_bank_to_25_deg_down; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + return lim_launched_rc_track_diag_25_deg_down_to_left_bank; + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + return lim_launched_rc_track_diag_25_deg_down_to_right_bank; + case TRACK_ELEM_DIAG_LEFT_BANK: + return lim_launched_rc_track_diag_left_bank; + case TRACK_ELEM_DIAG_RIGHT_BANK: + return lim_launched_rc_track_diag_right_bank; + case TRACK_ELEM_90_DEG_TO_INVERTED_FLAT_QUARTER_LOOP_UP: + return lim_launched_rc_track_90_deg_to_inverted_flat_quarter_loop_up; + case TRACK_ELEM_INVERTED_FLAT_TO_90_DEG_QUARTER_LOOP_DOWN: + return lim_launched_rc_track_inverted_flat_to_90_deg_quarter_loop_down; + case TRACK_ELEM_BLOCK_BRAKES: + return lim_launched_rc_track_block_brakes; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return lim_launched_rc_track_left_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + return lim_launched_rc_track_right_banked_quarter_turn_3_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return lim_launched_rc_track_left_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + return lim_launched_rc_track_right_banked_quarter_turn_3_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return lim_launched_rc_track_left_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + return lim_launched_rc_track_right_banked_quarter_turn_5_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return lim_launched_rc_track_left_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + return lim_launched_rc_track_right_banked_quarter_turn_5_25_deg_down; + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANKED_25_DEG_UP: + return lim_launched_rc_track_25_deg_up_to_left_banked_25_deg_up; + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANKED_25_DEG_UP: + return lim_launched_rc_track_25_deg_up_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return lim_launched_rc_track_left_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_25_DEG_UP: + return lim_launched_rc_track_right_banked_25_deg_up_to_25_deg_up; + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANKED_25_DEG_DOWN: + return lim_launched_rc_track_25_deg_down_to_left_banked_25_deg_down; + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANKED_25_DEG_DOWN: + return lim_launched_rc_track_25_deg_down_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return lim_launched_rc_track_left_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + return lim_launched_rc_track_right_banked_25_deg_down_to_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return lim_launched_rc_track_left_banked_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return lim_launched_rc_track_right_banked_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_LEFT_BANKED_FLAT: + return lim_launched_rc_track_left_banked_25_deg_up_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_RIGHT_BANKED_FLAT: + return lim_launched_rc_track_right_banked_25_deg_up_to_right_banked_flat; + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return lim_launched_rc_track_left_banked_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return lim_launched_rc_track_right_banked_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_LEFT_BANKED_FLAT: + return lim_launched_rc_track_left_banked_25_deg_down_to_left_banked_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_RIGHT_BANKED_FLAT: + return lim_launched_rc_track_right_banked_25_deg_down_to_right_banked_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_UP: + return lim_launched_rc_track_flat_to_left_banked_25_deg_up; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + return lim_launched_rc_track_flat_to_right_banked_25_deg_up; + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_FLAT: + return lim_launched_rc_track_left_banked_25_deg_up_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_FLAT: + return lim_launched_rc_track_right_banked_25_deg_up_to_flat; + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + return lim_launched_rc_track_flat_to_left_banked_25_deg_down; + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + return lim_launched_rc_track_flat_to_right_banked_25_deg_down; + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_FLAT: + return lim_launched_rc_track_left_banked_25_deg_down_to_flat; + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_FLAT: + return lim_launched_rc_track_right_banked_25_deg_down_to_flat; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_90_DEG_UP: + return lim_launched_rc_track_left_quarter_turn_1_90_deg_up; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_90_DEG_UP: + return lim_launched_rc_track_right_quarter_turn_1_90_deg_up; + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_90_DEG_DOWN: + return lim_launched_rc_track_left_quarter_turn_1_90_deg_down; + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_90_DEG_DOWN: + return lim_launched_rc_track_right_quarter_turn_1_90_deg_down; + } + return NULL; +} diff --git a/src/ride/track_data.c b/src/ride/track_data.c index 5904692d71..0d00fe0c49 100644 --- a/src/ride/track_data.c +++ b/src/ride/track_data.c @@ -6331,7 +6331,7 @@ const TRACK_PAINT_FUNCTION_GETTER RideTypeTrackPaintFunctions[91] = { get_track_paint_function_mini_rc, // RIDE_TYPE_MINI_ROLLER_COASTER get_track_paint_function_mine_ride, // RIDE_TYPE_MINE_RIDE 0, // RIDE_TYPE_59 - 0, // RIDE_TYPE_LIM_LAUNCHED_ROLLER_COASTER + get_track_paint_function_lim_launched_rc, // RIDE_TYPE_LIM_LAUNCHED_ROLLER_COASTER }; const track_descriptor gTrackDescriptors[142] = { diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index dd2fd7c50b..8fcf1eee66 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -331,5 +331,6 @@ TRACK_PAINT_FUNCTION get_track_paint_function_enterprise(int trackType, int dire TRACK_PAINT_FUNCTION get_track_paint_function_inverted_impulse_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_mini_rc(int trackType, int direction); TRACK_PAINT_FUNCTION get_track_paint_function_mine_ride(int trackType, int direction); +TRACK_PAINT_FUNCTION get_track_paint_function_lim_launched_rc(int trackType, int direction); #endif From a87ab47b1f2f1358b2a1a372cac9da4e29618df0 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 18:26:11 +0100 Subject: [PATCH 28/55] Fix bobsleigh coaster painting --- src/ride/coaster/bobsleigh_coaster.c | 22 ++++++++++++++++++++++ src/ride/track_paint.c | 13 +++++++++---- src/ride/track_paint.h | 1 + 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/ride/coaster/bobsleigh_coaster.c b/src/ride/coaster/bobsleigh_coaster.c index ae7cea39a9..b1f186fe4e 100644 --- a/src/ride/coaster/bobsleigh_coaster.c +++ b/src/ride/coaster/bobsleigh_coaster.c @@ -66,6 +66,24 @@ static void bobsleigh_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 paint_util_set_general_support_height(height + 32, 0x20); } +static void bobsleigh_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][2] = { + { 14580, SPR_STATION_BASE_B_SW_NE }, + { 14581, SPR_STATION_BASE_B_NW_SE }, + { 14580, SPR_STATION_BASE_B_SW_NE }, + { 14581, SPR_STATION_BASE_B_NW_SE }, + }; + + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); + sub_98196C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 0); + track_paint_util_draw_station(rideIndex, trackSequence, direction, height, 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 + 32, 0x20); +} + static void bobsleigh_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -2191,6 +2209,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_bobsleigh_rc(int trackType, int di switch (trackType) { case TRACK_ELEM_FLAT: return bobsleigh_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return bobsleigh_rc_track_station; case TRACK_ELEM_25_DEG_UP: return bobsleigh_rc_track_25_deg_up; case TRACK_ELEM_FLAT_TO_25_DEG_UP: diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index cee1c1f7c5..e5735d4fce 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -555,13 +555,18 @@ void track_paint_util_draw_pier(rct_ride * ride, const rct_ride_entrance_definit } void track_paint_util_draw_station_metal_supports(uint8 direction, uint16 height, uint32 colour) +{ + track_paint_util_draw_station_metal_supports_2(direction, height, colour, 3); +} + +void track_paint_util_draw_station_metal_supports_2(uint8 direction, uint16 height, uint32 colour, uint8 type) { if (direction & 1) { - metal_a_supports_paint_setup(3, 6, 0, height, colour); - metal_a_supports_paint_setup(3, 7, 0, height, colour); + metal_a_supports_paint_setup(type, 6, 0, height, colour); + metal_a_supports_paint_setup(type, 7, 0, height, colour); } else { - metal_a_supports_paint_setup(3, 5, 0, height, colour); - metal_a_supports_paint_setup(3, 8, 0, height, colour); + metal_a_supports_paint_setup(type, 5, 0, height, colour); + metal_a_supports_paint_setup(type, 8, 0, height, colour); } } diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 8fcf1eee66..17225e275c 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -231,6 +231,7 @@ void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 d 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); void track_paint_util_draw_station_metal_supports(uint8 direction, uint16 height, uint32 colour); +void track_paint_util_draw_station_metal_supports_2(uint8 direction, uint16 height, uint32 colour, uint8 type); 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_xyz16 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]); From d864cb95d1eabc283f998ad8964a083801fa679e Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 19:18:46 +0100 Subject: [PATCH 29/55] Enable multi processor compile for testpaint --- test/testpaint/testpaint.vcxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/testpaint/testpaint.vcxproj b/test/testpaint/testpaint.vcxproj index 281bccfa48..408880c1f8 100644 --- a/test/testpaint/testpaint.vcxproj +++ b/test/testpaint/testpaint.vcxproj @@ -66,6 +66,7 @@ __TESTPAINT__;DEBUG;NO_VEHICLES;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) true 4200 + true @@ -78,6 +79,7 @@ __TESTPAINT__;NO_VEHICLES;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;CURL_STATICLIB;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;%(PreprocessorDefinitions) true 4200 + true true From 842a52e193f213bd924fe7a5c99cc54026345ec8 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 19:19:20 +0100 Subject: [PATCH 30/55] Fix compact inverted coaster painting --- src/ride/coaster/compact_inverted_coaster.c | 30 +++- src/ride/track_paint.c | 151 +++++++++++++++++++- src/ride/track_paint.h | 16 ++- test/testpaint/intercept.c | 1 + test/testpaint/testpaint.vcxproj | 1 + 5 files changed, 188 insertions(+), 11 deletions(-) diff --git a/src/ride/coaster/compact_inverted_coaster.c b/src/ride/coaster/compact_inverted_coaster.c index f558da5c68..09be59f5f0 100644 --- a/src/ride/coaster/compact_inverted_coaster.c +++ b/src/ride/coaster/compact_inverted_coaster.c @@ -62,6 +62,25 @@ static void compact_inverted_rc_track_flat(uint8 rideIndex, uint8 trackSequence, paint_util_set_general_support_height(height + 48, 0x20); } +static void compact_inverted_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { SPR_STATION_BASE_C_SW_NE, 26557, SPR_STATION_INVERTED_BAR_A_SW_NE }, + { SPR_STATION_BASE_C_NW_SE, 26558, SPR_STATION_INVERTED_BAR_A_NW_SE }, + { SPR_STATION_BASE_C_SW_NE, 26557, SPR_STATION_INVERTED_BAR_A_SW_NE }, + { SPR_STATION_BASE_C_NW_SE, 26558, SPR_STATION_INVERTED_BAR_A_NW_SE }, + }; + + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_MISC], 0, 0, 32, 28, 1, height, 0, 2, height); + sub_98197C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + sub_98199C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 3, height + 29, 0, 6, height + 29); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 11); + track_paint_util_draw_station_inverted(rideIndex, trackSequence, direction, height, mapElement); + paint_util_push_tunnel_rotated(direction, height, TUNNEL_9); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + static void compact_inverted_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -3174,32 +3193,27 @@ static void compact_inverted_rc_track_on_ride_photo(uint8 rideIndex, uint8 track 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] | 26555, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); - 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] | 26556, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); - 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] | 26555, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); - 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] | 26556, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); - 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_3); paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 64, 0x20); @@ -5504,6 +5518,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_compact_inverted_rc(int trackType, switch (trackType) { case TRACK_ELEM_FLAT: return compact_inverted_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return compact_inverted_rc_track_station; case TRACK_ELEM_25_DEG_UP: return compact_inverted_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index e5735d4fce..598f277829 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -419,7 +419,146 @@ void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 d } } +void track_paint_util_draw_station_inverted(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + rct_xy16 position = {gPaintMapPosition.x, gPaintMapPosition.y}; + rct_ride * ride = get_ride(rideIndex); + const rct_ride_entrance_definition * entranceStyle = &RideEntranceDefinitions[ride->entrance_style]; + const bool hasGreenLight = (bool) (mapElement->properties.track.sequence & 0x80); + + bool hasFence; + uint32 imageId; + + if (direction == 0 || direction == 2) { + //height += 5 (height + 5); + hasFence = track_paint_util_has_fence(EDGE_NW, position, mapElement, ride, get_current_rotation()); + + if (mapElement->properties.track.type == TRACK_ELEM_END_STATION && direction == 0) { + if (hasGreenLight) { + imageId = (hasFence ? SPR_STATION_PLATFORM_FENCED_END_GREEN_LIGHT_SW_NE : SPR_STATION_PLATFORM_END_GREEN_LIGHT_SW_NE) | gTrackColours[SCHEME_SUPPORTS]; + } else { + imageId = (hasFence ? SPR_STATION_PLATFORM_FENCED_END_RED_LIGHT_SW_NE : SPR_STATION_PLATFORM_END_RED_LIGHT_SW_NE) | gTrackColours[SCHEME_SUPPORTS]; + } + } else if (mapElement->properties.track.type == TRACK_ELEM_BEGIN_STATION && direction == 2) { + imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_SW_NE : SPR_STATION_PLATFORM_BEGIN_SW_NE) | gTrackColours[SCHEME_SUPPORTS]; + } else { + imageId = (hasFence ? SPR_STATION_PLATFORM_FENCED_SW_NE : SPR_STATION_PLATFORM_SW_NE) | gTrackColours[SCHEME_SUPPORTS]; + } + sub_98196C(imageId, 0, 0, 32, 8, 1, height + 6, get_current_rotation()); + //height -= 5 (height) + track_paint_util_draw_station_covers_2(EDGE_NW, hasFence, entranceStyle, direction, height, true); + //height += 5 (height + 5) + + if (mapElement->properties.track.type == TRACK_ELEM_END_STATION && direction == 0) { + imageId = (hasGreenLight ? SPR_STATION_PLATFORM_END_GREEN_LIGHT_SW_NE : SPR_STATION_PLATFORM_END_RED_LIGHT_SW_NE) | gTrackColours[SCHEME_SUPPORTS]; + } else if (mapElement->properties.track.type == TRACK_ELEM_BEGIN_STATION && direction == 2) { + imageId = SPR_STATION_PLATFORM_BEGIN_SW_NE | gTrackColours[SCHEME_SUPPORTS]; + } else { + imageId = SPR_STATION_PLATFORM_SW_NE | gTrackColours[SCHEME_SUPPORTS]; + } + sub_98196C(imageId, 0, 24, 32, 8, 1, height + 6, get_current_rotation()); + //height += 2 (height + 7) + + hasFence = track_paint_util_has_fence(EDGE_SE, position, mapElement, ride, get_current_rotation()); + if (hasFence) { + if (mapElement->properties.track.type == TRACK_ELEM_BEGIN_STATION && direction == 0) { + imageId = SPR_STATION_INVERTED_BEGIN_ANGLE_FENCE_SW_NE | gTrackColours[SCHEME_SUPPORTS]; + } else if (mapElement->properties.track.type == TRACK_ELEM_END_STATION && direction == 2) { + imageId = SPR_STATION_INVERTED_LIGHT_BACK_ANGLE_FENCED_NE_SW | gTrackColours[SCHEME_SUPPORTS]; + } else { + imageId = SPR_STATION_INVERTED_FENCE_SW_NE | gTrackColours[SCHEME_SUPPORTS]; + } + sub_98196C(imageId, 0, 31, 32, 1, 7, height + 8, get_current_rotation()); + } else if (mapElement->properties.track.type == TRACK_ELEM_BEGIN_STATION && direction == 0) { + // Addition: draw only small fence if there is an entrance/exit at the beginning + imageId = SPR_STATION_FENCE_SMALL_NW_SE | gTrackColours[SCHEME_SUPPORTS]; + sub_98196C(imageId, 31, 23, 1, 8, 7, height + 8, get_current_rotation()); + } else if (mapElement->properties.track.type == TRACK_ELEM_END_STATION && direction == 2) { + // Addition: draw only small fence if there is an entrance/exit at the end + imageId = SPR_STATION_LIGHT_BACK_NE_SW | gTrackColours[SCHEME_SUPPORTS]; + sub_98196C(imageId, 31, 23, 1, 8, 7, height + 8, get_current_rotation()); + } + //height -= 7 (height) + track_paint_util_draw_station_covers_2(EDGE_SE, hasFence, entranceStyle, direction, height, true); + //height += 7 (height + 7) + + if (mapElement->properties.track.type == TRACK_ELEM_BEGIN_STATION && direction == 0) { + imageId = SPR_STATION_FENCE_SMALL_NW_SE | gTrackColours[SCHEME_SUPPORTS]; + sub_98196C(imageId, 31, 0, 1, 8, 7, height + 8, get_current_rotation()); + } else if (mapElement->properties.track.type == TRACK_ELEM_END_STATION && direction == 2) { + imageId = SPR_STATION_LIGHT_BACK_NE_SW | gTrackColours[SCHEME_SUPPORTS]; + sub_98196C(imageId, 31, 0, 1, 8, 7, height + 8, get_current_rotation()); + } + } else if (direction == 1 || direction == 3) { + //height += 5 (height + 5); + hasFence = track_paint_util_has_fence(EDGE_NE, position, mapElement, ride, get_current_rotation()); + + if (mapElement->properties.track.type == TRACK_ELEM_END_STATION && direction == 3) { + if (hasGreenLight) { + imageId = (hasFence ? SPR_STATION_PLATFORM_FENCED_END_GREEN_LIGHT_NW_SE : SPR_STATION_PLATFORM_END_GREEN_LIGHT_NW_SE) | gTrackColours[SCHEME_SUPPORTS]; + } else { + imageId = (hasFence ? SPR_STATION_PLATFORM_FENCED_END_RED_LIGHT_NW_SE : SPR_STATION_PLATFORM_END_RED_LIGHT_NW_SE) | gTrackColours[SCHEME_SUPPORTS]; + } + } else if (mapElement->properties.track.type == TRACK_ELEM_BEGIN_STATION && direction == 1) { + imageId = (hasFence ? SPR_STATION_PLATFORM_BEGIN_FENCED_NW_SE : SPR_STATION_PLATFORM_BEGIN_NW_SE) | gTrackColours[SCHEME_SUPPORTS]; + } else { + imageId = (hasFence ? SPR_STATION_PLATFORM_FENCED_NW_SE : SPR_STATION_PLATFORM_NW_SE) | gTrackColours[SCHEME_SUPPORTS]; + } + sub_98196C(imageId, 0, 0, 8, 32, 1, height + 6, get_current_rotation()); + //height -= 5 (height) + track_paint_util_draw_station_covers_2(EDGE_NE, hasFence, entranceStyle, direction, height, true); + //height += 5 (height + 5) + + if (mapElement->properties.track.type == TRACK_ELEM_END_STATION && direction == 3) { + imageId = (hasGreenLight ? SPR_STATION_PLATFORM_END_GREEN_LIGHT_NW_SE : SPR_STATION_PLATFORM_END_RED_LIGHT_NW_SE) | gTrackColours[SCHEME_SUPPORTS]; + } else if (mapElement->properties.track.type == TRACK_ELEM_BEGIN_STATION && direction == 1) { + imageId = SPR_STATION_PLATFORM_BEGIN_NW_SE | gTrackColours[SCHEME_SUPPORTS]; + } else { + imageId = SPR_STATION_PLATFORM_NW_SE | gTrackColours[SCHEME_SUPPORTS]; + } + sub_98196C(imageId, 24, 0, 8, 32, 1, height + 6, get_current_rotation()); + //height += 2 (height + 7) + + hasFence = track_paint_util_has_fence(EDGE_SW, position, mapElement, ride, get_current_rotation()); + if (hasFence) { + if (mapElement->properties.track.type == TRACK_ELEM_BEGIN_STATION && direction == 3) { + imageId = SPR_STATION_INVERTED_BEGIN_ANGLE_FENCE_NW_SE | gTrackColours[SCHEME_SUPPORTS]; + } else if (mapElement->properties.track.type == TRACK_ELEM_END_STATION && direction == 1) { + imageId = SPR_STATION_INVERTED_LIGHT_BACK_ANGLE_FENCED_NW_SE | gTrackColours[SCHEME_SUPPORTS]; + } else { + imageId = SPR_STATION_INVERTED_FENCE_NW_SE | gTrackColours[SCHEME_SUPPORTS]; + } + sub_98196C(imageId, 31, 0, 1, 32, 7, height + 8, get_current_rotation()); + } else if (mapElement->properties.track.type == TRACK_ELEM_BEGIN_STATION && direction == 3) { + // Addition: draw only small fence if there is an entrance/exit at the beginning + imageId = SPR_STATION_FENCE_SMALL_SW_NE | gTrackColours[SCHEME_SUPPORTS]; + sub_98196C(imageId, 23, 31, 8, 1, 7, height + 8, get_current_rotation()); + } else if (mapElement->properties.track.type == TRACK_ELEM_END_STATION && direction == 1) { + // Addition: draw only small fence if there is an entrance/exit at the end + imageId = SPR_STATION_LIGHT_BACK_NW_SE | gTrackColours[SCHEME_SUPPORTS]; + sub_98196C(imageId, 23, 31, 8, 1, 7, height + 8, get_current_rotation()); + } + + //height -= 7 (height) + track_paint_util_draw_station_covers_2(EDGE_SW, hasFence, entranceStyle, direction, height, true); + //height += 7 (height + 7) + + if (mapElement->properties.track.type == TRACK_ELEM_BEGIN_STATION && direction == 3) { + imageId = SPR_STATION_FENCE_SMALL_SW_NE | gTrackColours[SCHEME_SUPPORTS]; + sub_98196C(imageId, 0, 31, 8, 1, 7, height + 8, get_current_rotation()); + } else if (mapElement->properties.track.type == TRACK_ELEM_END_STATION && direction == 1) { + imageId = SPR_STATION_LIGHT_BACK_NW_SE | gTrackColours[SCHEME_SUPPORTS]; + sub_98196C(imageId, 0, 31, 8, 1, 7, height + 8, get_current_rotation()); + } + } +} + bool track_paint_util_draw_station_covers(enum edge edge, bool hasFence, const rct_ride_entrance_definition * entranceStyle, uint8 direction, uint16 height) +{ + return track_paint_util_draw_station_covers_2(edge, hasFence, entranceStyle, direction, height, false); +} + +bool track_paint_util_draw_station_covers_2(enum edge edge, bool hasFence, const rct_ride_entrance_definition * entranceStyle, uint8 direction, uint16 height, bool tall) { if (!(g141E9DB & (G141E9DB_FLAG_1 | G141E9DB_FLAG_2))) { return false; @@ -433,22 +572,22 @@ bool track_paint_util_draw_station_covers(enum edge edge, bool hasFence, const r offset = (rct_xyz16) {0, 0, height}; switch (edge) { case EDGE_NE: - bounds = (rct_xyz16) {1, 30, 0}; + bounds = (rct_xyz16) {1, 30, (tall ? 46 : 0)}; boundsOffset = (rct_xyz16) {0, 1, height + 1}; imageOffset = hasFence ? SPR_STATION_COVER_OFFSET_SE_NW_BACK_1 : SPR_STATION_COVER_OFFSET_SE_NW_BACK_0; break; case EDGE_SE: bounds = (rct_xyz16) {32, 32, 0}; - boundsOffset = (rct_xyz16) {1, 0, height + 23}; + boundsOffset = (rct_xyz16) {(tall ? 0 : 1), 0, height + (tall ? 47 : 23)}; imageOffset = SPR_STATION_COVER_OFFSET_NE_SW_FRONT; break; case EDGE_SW: bounds = (rct_xyz16) {32, 32, 0}; - boundsOffset = (rct_xyz16) {0, 0, height + 23}; + boundsOffset = (rct_xyz16) {0, 0, height + (tall ? 47 : 23)}; imageOffset = SPR_STATION_COVER_OFFSET_SE_NW_FRONT; break; case EDGE_NW: - bounds = (rct_xyz16) {30, 1, 30}; + bounds = (rct_xyz16) {30, 1, (tall ? 46 : 0)}; boundsOffset = (rct_xyz16) {1, 0, height + 1}; imageOffset = hasFence ? SPR_STATION_COVER_OFFSET_NE_SW_BACK_1 : SPR_STATION_COVER_OFFSET_NE_SW_BACK_0; break; @@ -462,6 +601,10 @@ bool track_paint_util_draw_station_covers(enum edge edge, bool hasFence, const r return false; } + if (tall) { + imageOffset += 6; + } + if (baseImageId & 0x40000000) { imageId = (baseImageId & 0xBFFFFFFF) + imageOffset; sub_98197C(imageId, (sint8)offset.x, (sint8)offset.y, bounds.x, bounds.y, (sint8)bounds.z, offset.z, boundsOffset.x, boundsOffset.y, boundsOffset.z, get_current_rotation()); diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 17225e275c..5f052f750b 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -118,6 +118,13 @@ enum { SPR_STATION_PLATFORM_END_RED_LIGHT_NW_SE = 22389, SPR_STATION_PLATFORM_END_GREEN_LIGHT_SW_NE = 22390, SPR_STATION_PLATFORM_END_GREEN_LIGHT_NW_SE = 22391, + SPR_STATION_INVERTED_FENCE_SW_NE = 22392, + SPR_STATION_INVERTED_FENCE_NW_SE = 22393, + SPR_STATION_INVERTED_BEGIN_ANGLE_FENCE_SW_NE = 22394, + SPR_STATION_INVERTED_BEGIN_ANGLE_FENCE_NW_SE = 22395, + + SPR_STATION_INVERTED_LIGHT_BACK_ANGLE_FENCED_NE_SW = 22396, + SPR_STATION_INVERTED_LIGHT_BACK_ANGLE_FENCED_NW_SE = 22397, SPR_STATION_PIER_EDGE_SE = 22404, SPR_STATION_PIER_EDGE_SW = 22405, @@ -134,11 +141,16 @@ enum { SPR_STATION_NARROW_EDGE_NW = 22416, SPR_STATION_NARROW_EDGE_NE = 22417, + SPR_STATION_INVERTED_BAR_A_SW_NE = 22422, + SPR_STATION_INVERTED_BAR_A_NW_SE = 22423, + SPR_STATION_INVERTED_BAR_B_SW_NE = 22424, + SPR_STATION_INVERTED_BAR_B_NW_SE = 22425, SPR_STATION_BASE_A_SW_NE = 22426, SPR_STATION_BASE_A_NW_SE = 22427, SPR_STATION_BASE_B_SW_NE = 22428, SPR_STATION_BASE_B_NW_SE = 22429, - + SPR_STATION_BASE_C_SW_NE = 22430, + SPR_STATION_BASE_C_NW_SE = 22431, SPR_STATION_BASE_D = 22432, SPR_ON_RIDE_PHOTO_CAMERA_N = 25615, @@ -226,8 +238,10 @@ bool track_paint_util_has_fence(enum edge edge, rct_xy16 position, rct_map_eleme void track_paint_util_paint_floor(uint8 edges, uint32 colourFlags, uint16 height, const uint32 floorSprites[4], uint8 rotation); void track_paint_util_paint_fences(uint8 edges, rct_xy16 position, rct_map_element * mapElement, rct_ride * ride, uint32 colourFlags, uint16 height, const uint32 fenceSprites[4], uint8 rotation); 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, bool tall); 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_inverted(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement); 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); void track_paint_util_draw_station_metal_supports(uint8 direction, uint16 height, uint32 colour); diff --git a/test/testpaint/intercept.c b/test/testpaint/intercept.c index b2a17a114d..179f61af32 100644 --- a/test/testpaint/intercept.c +++ b/test/testpaint/intercept.c @@ -511,6 +511,7 @@ static bool testTrackElement(uint8 rideType, uint8 trackType, utf8string *error) unk_140E9A8 = &dpi; rct_ride ride = { 0 }; + ride.entrance_style = RIDE_ENTRANCE_STYLE_CANVAS_TENT; rct_ride_entry rideEntry = { 0 }; rct_ride_entry_vehicle vehicleEntry = {.base_image_id = 0x70000}; diff --git a/test/testpaint/testpaint.vcxproj b/test/testpaint/testpaint.vcxproj index 408880c1f8..16162b45f2 100644 --- a/test/testpaint/testpaint.vcxproj +++ b/test/testpaint/testpaint.vcxproj @@ -67,6 +67,7 @@ true 4200 true + false From 1b65acc0fb089e23ac5e8a2f8f89a30448e35fd2 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 21:13:34 +0100 Subject: [PATCH 31/55] Fix corkscrew roller coaster painting --- src/ride/coaster/corkscrew_roller_coaster.c | 33 +++++++++++++++++---- src/ride/track_paint.c | 33 ++++++++++++--------- src/ride/track_paint.h | 1 + test/testpaint/intercept.c | 2 +- 4 files changed, 48 insertions(+), 21 deletions(-) diff --git a/src/ride/coaster/corkscrew_roller_coaster.c b/src/ride/coaster/corkscrew_roller_coaster.c index 686d414727..b4b13c7931 100644 --- a/src/ride/coaster/corkscrew_roller_coaster.c +++ b/src/ride/coaster/corkscrew_roller_coaster.c @@ -66,6 +66,28 @@ static void corkscrew_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 paint_util_set_general_support_height(height + 32, 0x20); } +static void corkscrew_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { 16236, 16232, SPR_STATION_BASE_A_SW_NE }, + { 16237, 16233, SPR_STATION_BASE_A_NW_SE }, + { 16236, 16232, SPR_STATION_BASE_A_SW_NE }, + { 16237, 16233, SPR_STATION_BASE_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, 20, 1, height, 0, 6, height + 3); + } else { + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); + } + sub_98196C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 0); + track_paint_util_draw_station_2(rideIndex, trackSequence, direction, height, mapElement, 9, 11); + 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 corkscrew_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -3160,32 +3182,27 @@ static void corkscrew_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequenc metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16224, 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(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16225, 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(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16224, 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(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 16225, 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_0); paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 48, 0x20); @@ -5772,6 +5789,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_corkscrew_rc(int trackType, int di switch (trackType) { case TRACK_ELEM_FLAT: return corkscrew_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return corkscrew_rc_track_station; case TRACK_ELEM_25_DEG_UP: return corkscrew_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: diff --git a/src/ride/track_paint.c b/src/ride/track_paint.c index 598f277829..6a9439f1bd 100644 --- a/src/ride/track_paint.c +++ b/src/ride/track_paint.c @@ -286,6 +286,11 @@ bool track_paint_util_should_paint_supports(rct_xy16 position) } void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + track_paint_util_draw_station_2(rideIndex, trackSequence, direction, 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) { rct_xy16 position = {gPaintMapPosition.x, gPaintMapPosition.y}; rct_ride * ride = get_ride(rideIndex); @@ -310,7 +315,7 @@ void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 d } else { imageId = (hasFence ? SPR_STATION_PLATFORM_FENCED_SW_NE : SPR_STATION_PLATFORM_SW_NE) | gTrackColours[SCHEME_SUPPORTS]; } - sub_98196C(imageId, 0, 0, 32, 8, 1, height + 5, get_current_rotation()); + 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); //height += 5 (height + 5) @@ -322,7 +327,7 @@ void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 d } else { imageId = SPR_STATION_PLATFORM_SW_NE | gTrackColours[SCHEME_SUPPORTS]; } - sub_98196C(imageId, 0, 24, 32, 8, 1, height + 5, get_current_rotation()); + sub_98196C(imageId, 0, 24, 32, 8, 1, height + fenceOffsetA, get_current_rotation()); //height += 2 (height + 7) hasFence = track_paint_util_has_fence(EDGE_SE, position, mapElement, ride, get_current_rotation()); @@ -334,15 +339,15 @@ void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 d } else { imageId = SPR_STATION_FENCE_SW_NE | gTrackColours[SCHEME_SUPPORTS]; } - sub_98196C(imageId, 0, 31, 32, 1, 7, height + 7, get_current_rotation()); + sub_98196C(imageId, 0, 31, 32, 1, 7, height + fenceOffsetB, get_current_rotation()); } else if (mapElement->properties.track.type == TRACK_ELEM_BEGIN_STATION && direction == 0) { // Addition: draw only small fence if there is an entrance/exit at the beginning imageId = SPR_STATION_FENCE_SMALL_NW_SE | gTrackColours[SCHEME_SUPPORTS]; - sub_98196C(imageId, 31, 23, 1, 8, 7, height + 7, get_current_rotation()); + sub_98196C(imageId, 31, 23, 1, 8, 7, height + fenceOffsetB, get_current_rotation()); } else if (mapElement->properties.track.type == TRACK_ELEM_END_STATION && direction == 2) { // Addition: draw only small fence if there is an entrance/exit at the end imageId = SPR_STATION_LIGHT_BACK_NE_SW | gTrackColours[SCHEME_SUPPORTS]; - sub_98196C(imageId, 31, 23, 1, 8, 7, height + 7, get_current_rotation()); + 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); @@ -350,10 +355,10 @@ void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 d if (mapElement->properties.track.type == TRACK_ELEM_BEGIN_STATION && direction == 0) { imageId = SPR_STATION_FENCE_SMALL_NW_SE | gTrackColours[SCHEME_SUPPORTS]; - sub_98196C(imageId, 31, 0, 1, 8, 7, height + 7, get_current_rotation()); + sub_98196C(imageId, 31, 0, 1, 8, 7, height + fenceOffsetB, get_current_rotation()); } else if (mapElement->properties.track.type == TRACK_ELEM_END_STATION && direction == 2) { imageId = SPR_STATION_LIGHT_BACK_NE_SW | gTrackColours[SCHEME_SUPPORTS]; - sub_98196C(imageId, 31, 0, 1, 8, 7, height + 7, get_current_rotation()); + sub_98196C(imageId, 31, 0, 1, 8, 7, height + fenceOffsetB, get_current_rotation()); } } else if (direction == 1 || direction == 3) { //height += 5 (height + 5); @@ -370,7 +375,7 @@ void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 d } else { imageId = (hasFence ? SPR_STATION_PLATFORM_FENCED_NW_SE : SPR_STATION_PLATFORM_NW_SE) | gTrackColours[SCHEME_SUPPORTS]; } - sub_98196C(imageId, 0, 0, 8, 32, 1, height + 5, get_current_rotation()); + 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); //height += 5 (height + 5) @@ -382,7 +387,7 @@ void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 d } else { imageId = SPR_STATION_PLATFORM_NW_SE | gTrackColours[SCHEME_SUPPORTS]; } - sub_98196C(imageId, 24, 0, 8, 32, 1, height + 5, get_current_rotation()); + sub_98196C(imageId, 24, 0, 8, 32, 1, height + fenceOffsetA, get_current_rotation()); //height += 2 (height + 7) hasFence = track_paint_util_has_fence(EDGE_SW, position, mapElement, ride, get_current_rotation()); @@ -394,15 +399,15 @@ void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 d } else { imageId = SPR_STATION_FENCE_NW_SE | gTrackColours[SCHEME_SUPPORTS]; } - sub_98196C(imageId, 31, 0, 1, 32, 7, height + 7, get_current_rotation()); + sub_98196C(imageId, 31, 0, 1, 32, 7, height + fenceOffsetB, get_current_rotation()); } else if (mapElement->properties.track.type == TRACK_ELEM_BEGIN_STATION && direction == 3) { // Addition: draw only small fence if there is an entrance/exit at the beginning imageId = SPR_STATION_FENCE_SMALL_SW_NE | gTrackColours[SCHEME_SUPPORTS]; - sub_98196C(imageId, 23, 31, 8, 1, 7, height + 7, get_current_rotation()); + sub_98196C(imageId, 23, 31, 8, 1, 7, height + fenceOffsetB, get_current_rotation()); } else if (mapElement->properties.track.type == TRACK_ELEM_END_STATION && direction == 1) { // Addition: draw only small fence if there is an entrance/exit at the end imageId = SPR_STATION_LIGHT_BACK_NW_SE | gTrackColours[SCHEME_SUPPORTS]; - sub_98196C(imageId, 23, 31, 8, 1, 7, height + 7, get_current_rotation()); + sub_98196C(imageId, 23, 31, 8, 1, 7, height + fenceOffsetB, get_current_rotation()); } //height -= 7 (height) @@ -411,10 +416,10 @@ void track_paint_util_draw_station(uint8 rideIndex, uint8 trackSequence, uint8 d if (mapElement->properties.track.type == TRACK_ELEM_BEGIN_STATION && direction == 3) { imageId = SPR_STATION_FENCE_SMALL_SW_NE | gTrackColours[SCHEME_SUPPORTS]; - sub_98196C(imageId, 0, 31, 8, 1, 7, height + 7, get_current_rotation()); + sub_98196C(imageId, 0, 31, 8, 1, 7, height + fenceOffsetB, get_current_rotation()); } else if (mapElement->properties.track.type == TRACK_ELEM_END_STATION && direction == 1) { imageId = SPR_STATION_LIGHT_BACK_NW_SE | gTrackColours[SCHEME_SUPPORTS]; - sub_98196C(imageId, 0, 31, 8, 1, 7, height + 7, get_current_rotation()); + sub_98196C(imageId, 0, 31, 8, 1, 7, height + fenceOffsetB, get_current_rotation()); } } } diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 5f052f750b..e0be573f02 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -241,6 +241,7 @@ bool track_paint_util_draw_station_covers(enum edge edge, bool hasFence, const r bool track_paint_util_draw_station_covers_2(enum edge edge, bool hasFence, const rct_ride_entrance_definition * entranceStyle, uint8 direction, uint16 height, bool tall); 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_inverted(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement); 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); diff --git a/test/testpaint/intercept.c b/test/testpaint/intercept.c index 179f61af32..468f1853cc 100644 --- a/test/testpaint/intercept.c +++ b/test/testpaint/intercept.c @@ -511,7 +511,7 @@ static bool testTrackElement(uint8 rideType, uint8 trackType, utf8string *error) unk_140E9A8 = &dpi; rct_ride ride = { 0 }; - ride.entrance_style = RIDE_ENTRANCE_STYLE_CANVAS_TENT; + // ride.entrance_style = RIDE_ENTRANCE_STYLE_CANVAS_TENT; rct_ride_entry rideEntry = { 0 }; rct_ride_entry_vehicle vehicleEntry = {.base_image_id = 0x70000}; From d5ad44cb4db4f9aed6f04d1e8e513a8af80dd53c Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 21:37:47 +0100 Subject: [PATCH 32/55] Fix flying roller coaster painting --- src/ride/coaster/flying_roller_coaster.c | 33 +++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/ride/coaster/flying_roller_coaster.c b/src/ride/coaster/flying_roller_coaster.c index 7031936396..5ad1417453 100644 --- a/src/ride/coaster/flying_roller_coaster.c +++ b/src/ride/coaster/flying_roller_coaster.c @@ -66,6 +66,28 @@ static void flying_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 dir paint_util_set_general_support_height(height + 32, 0x20); } +static void flying_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { 17154, 17150, SPR_STATION_BASE_A_SW_NE }, + { 17155, 17151, SPR_STATION_BASE_A_NW_SE }, + { 17154, 17150, SPR_STATION_BASE_A_SW_NE }, + { 17155, 17151, SPR_STATION_BASE_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, 20, 1, height, 0, 6, height + 3); + } else { + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); + } + sub_98196C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 11); + track_paint_util_draw_station_2(rideIndex, trackSequence, direction, height, mapElement, 9, 11); + 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 flying_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { switch (direction) { @@ -2942,32 +2964,27 @@ static void flying_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, 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] | 17146, 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] | 17147, 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] | 17146, 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] | 17147, 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); @@ -6605,6 +6622,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_flying_rc(int trackType, int direc switch (trackType) { case TRACK_ELEM_FLAT: return flying_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return flying_rc_track_station; case TRACK_ELEM_25_DEG_UP: return flying_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: From 0620481ad92c245fecf90b8c83380765aea0deed Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 21:42:53 +0100 Subject: [PATCH 33/55] Fix giga coaster painting --- src/ride/coaster/giga_coaster.c | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/ride/coaster/giga_coaster.c b/src/ride/coaster/giga_coaster.c index 6bab5c5764..f95dcd67b5 100644 --- a/src/ride/coaster/giga_coaster.c +++ b/src/ride/coaster/giga_coaster.c @@ -80,6 +80,28 @@ static void giga_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direc paint_util_set_general_support_height(height + 32, 0x20); } +static void giga_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { 18084, 18076, SPR_STATION_BASE_A_SW_NE }, + { 18085, 18077, SPR_STATION_BASE_A_NW_SE }, + { 18084, 18076, SPR_STATION_BASE_A_SW_NE }, + { 18085, 18077, SPR_STATION_BASE_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, 20, 1, height, 0, 6, height + 3); + } else { + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); + } + sub_98196C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 0); + track_paint_util_draw_station_2(rideIndex, trackSequence, direction, height, mapElement, 9, 11); + 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 giga_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_cable_lift(mapElement)) { @@ -2682,32 +2704,27 @@ static void giga_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, ui metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18074, 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(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18075, 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(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18074, 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(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18075, 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); @@ -6031,6 +6048,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_giga_rc(int trackType, int directi switch (trackType) { case TRACK_ELEM_FLAT: return giga_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return giga_rc_track_station; case TRACK_ELEM_25_DEG_UP: return giga_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: From a7e3fa54714916f8a6a427bc61d263ac27715fbe Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 21:48:29 +0100 Subject: [PATCH 34/55] Fix heartline twister roller coaster painting --- src/ride/coaster/heartline_twister_coaster.c | 38 +++++++++++++++----- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/ride/coaster/heartline_twister_coaster.c b/src/ride/coaster/heartline_twister_coaster.c index 47ee266a3f..3861bcf0b2 100644 --- a/src/ride/coaster/heartline_twister_coaster.c +++ b/src/ride/coaster/heartline_twister_coaster.c @@ -72,6 +72,24 @@ static void heartline_twister_rc_track_flat(uint8 rideIndex, uint8 trackSequence paint_util_set_general_support_height(height + 32, 0x20); } +static void heartline_twister_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { 19732, SPR_STATION_BASE_B_SW_NE }, + { 19733, SPR_STATION_BASE_B_NW_SE }, + { 19732, SPR_STATION_BASE_B_SW_NE }, + { 19733, SPR_STATION_BASE_B_NW_SE }, + }; + + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); + sub_98196C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 0); + track_paint_util_draw_station(rideIndex, trackSequence, direction, height, 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 + 32, 0x20); +} + static void heartline_twister_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -491,28 +509,28 @@ static void heartline_twister_rc_track_heartline_transfer_up(uint8 rideIndex, ui sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21308, 0, 0, 32, 20, 2, height + 16, 0, 6, height + 16); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21318, 0, 0, 32, 1, 34, height + 8, 0, 27, height + 8); sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21312, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); - wooden_a_supports_paint_setup(6, 5, height + 8, 0x00000000, NULL); + wooden_a_supports_paint_setup(6, 5, height + 8, gTrackColours[SCHEME_SUPPORTS], NULL); break; case 1: sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21315, 0, 0, 32, 20, 2, height + 8, 0, 6, height + 8); sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21309, 0, 0, 32, 20, 2, height + 16, 0, 6, height + 16); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21319, 0, 0, 32, 1, 34, height + 8, 0, 27, height + 8); sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21313, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); - wooden_a_supports_paint_setup(7, 6, height + 8, 0x00000000, NULL); + wooden_a_supports_paint_setup(7, 6, height + 8, gTrackColours[SCHEME_SUPPORTS], NULL); break; case 2: sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21316, 0, 0, 32, 20, 2, height + 8, 0, 6, height + 8); sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21306, 0, 0, 32, 20, 2, height + 16, 0, 6, height + 16); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21320, 0, 0, 32, 1, 34, height + 8, 0, 27, height + 8); sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21310, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); - wooden_a_supports_paint_setup(6, 7, height + 8, 0x00000000, NULL); + wooden_a_supports_paint_setup(6, 7, height + 8, gTrackColours[SCHEME_SUPPORTS], NULL); break; case 3: sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21317, 0, 0, 32, 20, 2, height + 8, 0, 6, height + 8); sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21307, 0, 0, 32, 20, 2, height + 16, 0, 6, height + 16); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21321, 0, 0, 32, 1, 34, height + 8, 0, 27, height + 8); sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21311, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); - wooden_a_supports_paint_setup(7, 8, height + 8, 0x00000000, NULL); + wooden_a_supports_paint_setup(7, 8, height + 8, gTrackColours[SCHEME_SUPPORTS], NULL); break; } paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); @@ -611,28 +629,28 @@ static void heartline_twister_rc_track_heartline_transfer_down(uint8 rideIndex, sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21308, 0, 0, 32, 20, 2, height + 16, 0, 6, height + 16); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21318, 0, 0, 32, 1, 34, height + 8, 0, 27, height + 8); sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21312, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); - wooden_a_supports_paint_setup(6, 5, height + 8, 0x00000000, NULL); + wooden_a_supports_paint_setup(6, 5, height + 8, gTrackColours[SCHEME_SUPPORTS], NULL); break; case 1: sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21315, 0, 0, 32, 20, 2, height + 8, 0, 6, height + 8); sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21309, 0, 0, 32, 20, 2, height + 16, 0, 6, height + 16); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21319, 0, 0, 32, 1, 34, height + 8, 0, 27, height + 8); sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21313, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); - wooden_a_supports_paint_setup(7, 6, height + 8, 0x00000000, NULL); + wooden_a_supports_paint_setup(7, 6, height + 8, gTrackColours[SCHEME_SUPPORTS], NULL); break; case 2: sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21316, 0, 0, 32, 20, 2, height + 8, 0, 6, height + 8); sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21306, 0, 0, 32, 20, 2, height + 16, 0, 6, height + 16); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21320, 0, 0, 32, 1, 34, height + 8, 0, 27, height + 8); sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21310, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); - wooden_a_supports_paint_setup(6, 7, height + 8, 0x00000000, NULL); + wooden_a_supports_paint_setup(6, 7, height + 8, gTrackColours[SCHEME_SUPPORTS], NULL); break; case 3: sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21317, 0, 0, 32, 20, 2, height + 8, 0, 6, height + 8); sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21307, 0, 0, 32, 20, 2, height + 16, 0, 6, height + 16); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21321, 0, 0, 32, 1, 34, height + 8, 0, 27, height + 8); sub_98199C_rotated(direction, gTrackColours[SCHEME_TRACK] | 21311, 0, 0, 32, 1, 34, height + 16, 0, 27, height + 16); - wooden_a_supports_paint_setup(7, 8, height + 8, 0x00000000, NULL); + wooden_a_supports_paint_setup(7, 8, height + 8, gTrackColours[SCHEME_SUPPORTS], NULL); break; } paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); @@ -1031,6 +1049,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_heartline_twister_rc(int trackType switch (trackType) { case TRACK_ELEM_FLAT: return heartline_twister_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return heartline_twister_rc_track_station; case TRACK_ELEM_25_DEG_UP: return heartline_twister_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: From 53bc7d51c8b5a4cbfc6579c5aab150a90f405694 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 21:56:17 +0100 Subject: [PATCH 35/55] Fix inverted hairpin coaster painting --- src/ride/coaster/inverted_hairpin_coaster.c | 23 +++++++++++++++++++++ src/ride/track_paint.h | 2 ++ 2 files changed, 25 insertions(+) diff --git a/src/ride/coaster/inverted_hairpin_coaster.c b/src/ride/coaster/inverted_hairpin_coaster.c index 15b64fc1e8..8db06aea26 100644 --- a/src/ride/coaster/inverted_hairpin_coaster.c +++ b/src/ride/coaster/inverted_hairpin_coaster.c @@ -66,6 +66,25 @@ static void inverted_hairpin_rc_track_flat(uint8 rideIndex, uint8 trackSequence, paint_util_set_general_support_height(height + 32, 0x20); } +static void inverted_hairpin_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { SPR_STATION_BASE_C_SW_NE, 17028, SPR_STATION_INVERTED_BAR_0_SW_NE }, + { SPR_STATION_BASE_C_NW_SE, 17029, SPR_STATION_INVERTED_BAR_0_NW_SE }, + { SPR_STATION_BASE_C_SW_NE, 17028, SPR_STATION_INVERTED_BAR_0_SW_NE }, + { SPR_STATION_BASE_C_NW_SE, 17029, SPR_STATION_INVERTED_BAR_0_NW_SE }, + }; + + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_MISC], 0, 0, 32, 28, 1, height, 0, 2, height); + sub_98197C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 3, height + 24, 0, 6, height + 24); + sub_98199C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 1, height + 24, 0, 6, height + 24); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 11); + track_paint_util_draw_station_inverted(rideIndex, trackSequence, direction, height, 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 + 32, 0x20); +} + static void inverted_hairpin_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -861,6 +880,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_inverted_hairpin_rc(int trackType, switch (trackType) { case TRACK_ELEM_FLAT: return inverted_hairpin_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return inverted_hairpin_rc_track_station; case TRACK_ELEM_25_DEG_UP: return inverted_hairpin_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index e0be573f02..b361e43c6d 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -141,6 +141,8 @@ enum { SPR_STATION_NARROW_EDGE_NW = 22416, SPR_STATION_NARROW_EDGE_NE = 22417, + SPR_STATION_INVERTED_BAR_0_SW_NE = 22420, + SPR_STATION_INVERTED_BAR_0_NW_SE = 22421, SPR_STATION_INVERTED_BAR_A_SW_NE = 22422, SPR_STATION_INVERTED_BAR_A_NW_SE = 22423, SPR_STATION_INVERTED_BAR_B_SW_NE = 22424, From 62627af58284eae1926d0fe570be9a875f92a0b3 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 22:22:28 +0100 Subject: [PATCH 36/55] Fix inverted inverted impulse coaster painting --- src/ride/coaster/inverted_impulse_coaster.c | 23 +++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/ride/coaster/inverted_impulse_coaster.c b/src/ride/coaster/inverted_impulse_coaster.c index 51ee56c6e7..5fcfe4b9ac 100644 --- a/src/ride/coaster/inverted_impulse_coaster.c +++ b/src/ride/coaster/inverted_impulse_coaster.c @@ -46,6 +46,25 @@ static void inverted_impulse_rc_track_flat(uint8 rideIndex, uint8 trackSequence, paint_util_set_general_support_height(height + 48, 0x20); } +static void inverted_impulse_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { SPR_STATION_BASE_C_SW_NE, 19662, SPR_STATION_INVERTED_BAR_B_SW_NE }, + { SPR_STATION_BASE_C_NW_SE, 19663, SPR_STATION_INVERTED_BAR_B_NW_SE }, + { SPR_STATION_BASE_C_SW_NE, 19662, SPR_STATION_INVERTED_BAR_B_SW_NE }, + { SPR_STATION_BASE_C_NW_SE, 19663, SPR_STATION_INVERTED_BAR_B_NW_SE }, + }; + + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_MISC], 0, 0, 32, 28, 1, height, 0, 2, height); + sub_98197C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + sub_98199C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 3, height + 29, 0, 6, height + 29); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 11); + track_paint_util_draw_station_inverted(rideIndex, trackSequence, direction, height, mapElement); + paint_util_push_tunnel_rotated(direction, height, TUNNEL_9); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + static void inverted_impulse_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { switch (direction) { @@ -449,6 +468,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_inverted_impulse_rc(int trackType, switch (trackType) { case TRACK_ELEM_FLAT: return inverted_impulse_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return inverted_impulse_rc_track_station; case TRACK_ELEM_25_DEG_UP: return inverted_impulse_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: From 5a38697f1fc4ce66bcbda7ed56cf2488624173df Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 22:29:32 +0100 Subject: [PATCH 37/55] Fix inverted roller coaster painting --- src/ride/coaster/inverted_roller_coaster.c | 30 +++++++++++++++++----- src/ride/track_paint.h | 2 ++ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/ride/coaster/inverted_roller_coaster.c b/src/ride/coaster/inverted_roller_coaster.c index 86191dbd52..7d2ec78fab 100644 --- a/src/ride/coaster/inverted_roller_coaster.c +++ b/src/ride/coaster/inverted_roller_coaster.c @@ -62,6 +62,25 @@ static void inverted_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 d paint_util_set_general_support_height(height + 48, 0x20); } +static void inverted_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { SPR_STATION_BASE_C_SW_NE, 27131, SPR_STATION_INVERTED_BAR_C_SW_NE }, + { SPR_STATION_BASE_C_NW_SE, 27132, SPR_STATION_INVERTED_BAR_C_NW_SE }, + { SPR_STATION_BASE_C_SW_NE, 27131, SPR_STATION_INVERTED_BAR_C_SW_NE }, + { SPR_STATION_BASE_C_NW_SE, 27132, SPR_STATION_INVERTED_BAR_C_NW_SE }, + }; + + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_MISC], 0, 0, 32, 28, 1, height, 0, 2, height); + sub_98197C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + sub_98199C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 3, height + 29, 0, 6, height + 29); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 3); + track_paint_util_draw_station_inverted(rideIndex, trackSequence, direction, height, mapElement); + paint_util_push_tunnel_rotated(direction, height, TUNNEL_9); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + static void inverted_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -3181,32 +3200,27 @@ static void inverted_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence metal_a_supports_paint_setup(3, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(3, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27129, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); - 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(3, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(3, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27130, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); - 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(3, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(3, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27129, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); - 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(3, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(3, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 27130, 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); - 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_3); paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 64, 0x20); @@ -6503,6 +6517,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_inverted_rc(int trackType, int dir switch (trackType) { case TRACK_ELEM_FLAT: return inverted_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return inverted_rc_track_station; case TRACK_ELEM_25_DEG_UP: return inverted_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index b361e43c6d..bbe33ccfc8 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -125,6 +125,8 @@ enum { SPR_STATION_INVERTED_LIGHT_BACK_ANGLE_FENCED_NE_SW = 22396, SPR_STATION_INVERTED_LIGHT_BACK_ANGLE_FENCED_NW_SE = 22397, + SPR_STATION_INVERTED_BAR_C_SW_NE = 22398, + SPR_STATION_INVERTED_BAR_C_NW_SE = 22399, SPR_STATION_PIER_EDGE_SE = 22404, SPR_STATION_PIER_EDGE_SW = 22405, From a11e51fb663ccbeabd8cf7743884b00d1d4454e7 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 22:33:15 +0100 Subject: [PATCH 38/55] Fix lay down roller coaster painting --- src/ride/coaster/lay_down_roller_coaster.c | 33 ++++++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/ride/coaster/lay_down_roller_coaster.c b/src/ride/coaster/lay_down_roller_coaster.c index ee4c23d4e5..67c7708103 100644 --- a/src/ride/coaster/lay_down_roller_coaster.c +++ b/src/ride/coaster/lay_down_roller_coaster.c @@ -66,6 +66,28 @@ static void lay_down_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 d paint_util_set_general_support_height(height + 32, 0x20); } +static void lay_down_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { 16236, 16232, SPR_STATION_BASE_A_SW_NE }, + { 16237, 16233, SPR_STATION_BASE_A_NW_SE }, + { 16236, 16232, SPR_STATION_BASE_A_SW_NE }, + { 16237, 16233, SPR_STATION_BASE_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, 20, 1, height, 0, 6, height + 3); + } else { + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); + } + sub_98196C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 11); + track_paint_util_draw_station_2(rideIndex, trackSequence, direction, height, mapElement, 9, 11); + 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 lay_down_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -2910,32 +2932,27 @@ static void lay_down_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence 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] | 16224, 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] | 16225, 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] | 16224, 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] | 16225, 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_0); paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 48, 0x20); @@ -6072,6 +6089,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_lay_down_rc(int trackType, int dir switch (trackType) { case TRACK_ELEM_FLAT: return lay_down_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return lay_down_rc_track_station; case TRACK_ELEM_25_DEG_UP: return lay_down_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: From 34213e7cd84151a82f9ac3d821b2276ae3edd714 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 22:52:54 +0100 Subject: [PATCH 39/55] Fix lim launched roller coaster painting --- .../coaster/lim_launched_roller_coaster.c | 343 +++++++----------- 1 file changed, 122 insertions(+), 221 deletions(-) diff --git a/src/ride/coaster/lim_launched_roller_coaster.c b/src/ride/coaster/lim_launched_roller_coaster.c index 7dba41102a..43fe39e56f 100644 --- a/src/ride/coaster/lim_launched_roller_coaster.c +++ b/src/ride/coaster/lim_launched_roller_coaster.c @@ -66,6 +66,28 @@ static void lim_launched_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uin paint_util_set_general_support_height(height + 32, 0x20); } +static void lim_launched_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { 15018, 15020, SPR_STATION_BASE_B_SW_NE }, + { 15019, 15021, SPR_STATION_BASE_B_NW_SE }, + { 15018, 15020, SPR_STATION_BASE_B_SW_NE }, + { 15019, 15021, SPR_STATION_BASE_B_NW_SE }, + }; + + if (mapElement->properties.track.type == TRACK_ELEM_END_STATION) { + sub_98197C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); + } else { + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); + } + sub_98196C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 0); + track_paint_util_draw_station(rideIndex, trackSequence, direction, height, 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 + 32, 0x20); +} + static void lim_launched_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -6895,100 +6917,147 @@ static void lim_launched_rc_track_right_quarter_turn_1_90_deg_down(uint8 rideInd TRACK_PAINT_FUNCTION get_track_paint_function_lim_launched_rc(int trackType, int direction) { switch (trackType) { + + // Use Looping Roller Coaster case TRACK_ELEM_FLAT: - return lim_launched_rc_track_flat; case TRACK_ELEM_25_DEG_UP: - return lim_launched_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: - return lim_launched_rc_track_60_deg_up; case TRACK_ELEM_FLAT_TO_25_DEG_UP: - return lim_launched_rc_track_flat_to_25_deg_up; case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: - return lim_launched_rc_track_25_deg_up_to_60_deg_up; case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: - return lim_launched_rc_track_60_deg_up_to_25_deg_up; case TRACK_ELEM_25_DEG_UP_TO_FLAT: - return lim_launched_rc_track_25_deg_up_to_flat; case TRACK_ELEM_25_DEG_DOWN: - return lim_launched_rc_track_25_deg_down; case TRACK_ELEM_60_DEG_DOWN: - return lim_launched_rc_track_60_deg_down; case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: - return lim_launched_rc_track_flat_to_25_deg_down; case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: - return lim_launched_rc_track_25_deg_down_to_60_deg_down; case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: - return lim_launched_rc_track_60_deg_down_to_25_deg_down; case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: - return lim_launched_rc_track_25_deg_down_to_flat; case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: - return lim_launched_rc_track_left_quarter_turn_5; case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: - return lim_launched_rc_track_right_quarter_turn_5; case TRACK_ELEM_FLAT_TO_LEFT_BANK: - return lim_launched_rc_track_flat_to_left_bank; case TRACK_ELEM_FLAT_TO_RIGHT_BANK: - return lim_launched_rc_track_flat_to_right_bank; case TRACK_ELEM_LEFT_BANK_TO_FLAT: - return lim_launched_rc_track_left_bank_to_flat; case TRACK_ELEM_RIGHT_BANK_TO_FLAT: - return lim_launched_rc_track_right_bank_to_flat; case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: - return lim_launched_rc_track_banked_left_quarter_turn_5; case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: - return lim_launched_rc_track_banked_right_quarter_turn_5; case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: - return lim_launched_rc_track_left_bank_to_25_deg_up; case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: - return lim_launched_rc_track_right_bank_to_25_deg_up; case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: - return lim_launched_rc_track_25_deg_up_to_left_bank; case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: - return lim_launched_rc_track_25_deg_up_to_right_bank; case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: - return lim_launched_rc_track_left_bank_to_25_deg_down; case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: - return lim_launched_rc_track_right_bank_to_25_deg_down; case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: - return lim_launched_rc_track_25_deg_down_to_left_bank; case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: - return lim_launched_rc_track_25_deg_down_to_right_bank; case TRACK_ELEM_LEFT_BANK: - return lim_launched_rc_track_left_bank; case TRACK_ELEM_RIGHT_BANK: - return lim_launched_rc_track_right_bank; case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: - return lim_launched_rc_track_left_quarter_turn_5_25_deg_up; case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: - return lim_launched_rc_track_right_quarter_turn_5_25_deg_up; case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: - return lim_launched_rc_track_left_quarter_turn_5_25_deg_down; case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: - return lim_launched_rc_track_right_quarter_turn_5_25_deg_down; case TRACK_ELEM_S_BEND_LEFT: - return lim_launched_rc_track_s_bend_left; case TRACK_ELEM_S_BEND_RIGHT: - return lim_launched_rc_track_s_bend_right; + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: + case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: + case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: + case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP: + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP: + case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN: + case TRACK_ELEM_25_DEG_UP_LEFT_BANKED: + case TRACK_ELEM_25_DEG_UP_RIGHT_BANKED: + case TRACK_ELEM_ON_RIDE_PHOTO: + case TRACK_ELEM_25_DEG_DOWN_LEFT_BANKED: + case TRACK_ELEM_25_DEG_DOWN_RIGHT_BANKED: + case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: + case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: + case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: + case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: + case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: + case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: + case TRACK_ELEM_DIAG_FLAT: + case TRACK_ELEM_DIAG_25_DEG_UP: + case TRACK_ELEM_DIAG_60_DEG_UP: + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: + case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: + case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: + case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: + case TRACK_ELEM_DIAG_25_DEG_DOWN: + case TRACK_ELEM_DIAG_60_DEG_DOWN: + case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: + case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: + case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: + case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: + case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: + case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: + case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: + case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: + case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: + case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: + case TRACK_ELEM_DIAG_LEFT_BANK: + case TRACK_ELEM_DIAG_RIGHT_BANK: + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANKED_25_DEG_UP: + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANKED_25_DEG_UP: + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_25_DEG_UP: + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_25_DEG_UP: + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANKED_25_DEG_DOWN: + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANKED_25_DEG_DOWN: + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_UP: + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_LEFT_BANKED_FLAT: + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_RIGHT_BANKED_FLAT: + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_LEFT_BANKED_FLAT: + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_RIGHT_BANKED_FLAT: + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_UP: + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_FLAT: + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_FLAT: + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_FLAT: + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_FLAT: + return get_track_paint_function_looping_rc(trackType, direction); + + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return lim_launched_rc_track_station; case TRACK_ELEM_LEFT_VERTICAL_LOOP: return lim_launched_rc_track_left_vertical_loop; case TRACK_ELEM_RIGHT_VERTICAL_LOOP: return lim_launched_rc_track_right_vertical_loop; - case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: - return lim_launched_rc_track_left_quarter_turn_3; - case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: - return lim_launched_rc_track_right_quarter_turn_3; - case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: - return lim_launched_rc_track_left_quarter_turn_3_bank; - case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: - return lim_launched_rc_track_right_quarter_turn_3_bank; - case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: - return lim_launched_rc_track_left_quarter_turn_3_25_deg_up; - case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: - return lim_launched_rc_track_right_quarter_turn_3_25_deg_up; - case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: - return lim_launched_rc_track_left_quarter_turn_3_25_deg_down; - case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: - return lim_launched_rc_track_right_quarter_turn_3_25_deg_down; case TRACK_ELEM_LEFT_TWIST_DOWN_TO_UP: return lim_launched_rc_track_left_twist_down_to_up; case TRACK_ELEM_RIGHT_TWIST_DOWN_TO_UP: @@ -7005,42 +7074,8 @@ TRACK_PAINT_FUNCTION get_track_paint_function_lim_launched_rc(int trackType, int return lim_launched_rc_track_left_corkscrew_down; case TRACK_ELEM_RIGHT_CORKSCREW_DOWN: return lim_launched_rc_track_right_corkscrew_down; - case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: - return lim_launched_rc_track_left_half_banked_helix_up_small; - case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: - return lim_launched_rc_track_right_half_banked_helix_up_small; - case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: - return lim_launched_rc_track_left_half_banked_helix_down_small; - case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: - return lim_launched_rc_track_right_half_banked_helix_down_small; - case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: - return lim_launched_rc_track_left_half_banked_helix_up_large; - case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: - return lim_launched_rc_track_right_half_banked_helix_up_large; - case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: - return lim_launched_rc_track_left_half_banked_helix_down_large; - case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: - return lim_launched_rc_track_right_half_banked_helix_down_large; - case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP: - return lim_launched_rc_track_left_quarter_turn_1_60_deg_up; - case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP: - return lim_launched_rc_track_right_quarter_turn_1_60_deg_up; - case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN: - return lim_launched_rc_track_left_quarter_turn_1_60_deg_down; - case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN: - return lim_launched_rc_track_right_quarter_turn_1_60_deg_down; case TRACK_ELEM_BRAKES: return lim_launched_rc_track_brakes; - case TRACK_ELEM_25_DEG_UP_LEFT_BANKED: - return lim_launched_rc_track_25_deg_up_left_banked; - case TRACK_ELEM_25_DEG_UP_RIGHT_BANKED: - return lim_launched_rc_track_25_deg_up_right_banked; - case TRACK_ELEM_ON_RIDE_PHOTO: - return lim_launched_rc_track_on_ride_photo; - case TRACK_ELEM_25_DEG_DOWN_LEFT_BANKED: - return lim_launched_rc_track_25_deg_down_left_banked; - case TRACK_ELEM_25_DEG_DOWN_RIGHT_BANKED: - return lim_launched_rc_track_25_deg_down_right_banked; case TRACK_ELEM_90_DEG_UP: return lim_launched_rc_track_90_deg_up; case TRACK_ELEM_90_DEG_DOWN: @@ -7053,146 +7088,12 @@ TRACK_PAINT_FUNCTION get_track_paint_function_lim_launched_rc(int trackType, int return lim_launched_rc_track_90_deg_up_to_60_deg_up; case TRACK_ELEM_60_DEG_DOWN_TO_90_DEG_DOWN: return lim_launched_rc_track_60_deg_down_to_90_deg_down; - case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: - return lim_launched_rc_track_left_eighth_to_diag; - case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: - return lim_launched_rc_track_right_eighth_to_diag; - case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: - return lim_launched_rc_track_left_eighth_to_orthogonal; - case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: - return lim_launched_rc_track_right_eighth_to_orthogonal; - case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: - return lim_launched_rc_track_left_eighth_bank_to_diag; - case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: - return lim_launched_rc_track_right_eighth_bank_to_diag; - case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: - return lim_launched_rc_track_left_eighth_bank_to_orthogonal; - case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: - return lim_launched_rc_track_right_eighth_bank_to_orthogonal; - case TRACK_ELEM_DIAG_FLAT: - return lim_launched_rc_track_diag_flat; - case TRACK_ELEM_DIAG_25_DEG_UP: - return lim_launched_rc_track_diag_25_deg_up; - case TRACK_ELEM_DIAG_60_DEG_UP: - return lim_launched_rc_track_diag_60_deg_up; - case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: - return lim_launched_rc_track_diag_flat_to_25_deg_up; - case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: - return lim_launched_rc_track_diag_25_deg_up_to_60_deg_up; - case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: - return lim_launched_rc_track_diag_60_deg_up_to_25_deg_up; - case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: - return lim_launched_rc_track_diag_25_deg_up_to_flat; - case TRACK_ELEM_DIAG_25_DEG_DOWN: - return lim_launched_rc_track_diag_25_deg_down; - case TRACK_ELEM_DIAG_60_DEG_DOWN: - return lim_launched_rc_track_diag_60_deg_down; - case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: - return lim_launched_rc_track_diag_flat_to_25_deg_down; - case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: - return lim_launched_rc_track_diag_25_deg_down_to_60_deg_down; - case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: - return lim_launched_rc_track_diag_60_deg_down_to_25_deg_down; - case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: - return lim_launched_rc_track_diag_25_deg_down_to_flat; - case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: - return lim_launched_rc_track_diag_flat_to_left_bank; - case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: - return lim_launched_rc_track_diag_flat_to_right_bank; - case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: - return lim_launched_rc_track_diag_left_bank_to_flat; - case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: - return lim_launched_rc_track_diag_right_bank_to_flat; - case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: - return lim_launched_rc_track_diag_left_bank_to_25_deg_up; - case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: - return lim_launched_rc_track_diag_right_bank_to_25_deg_up; - case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: - return lim_launched_rc_track_diag_25_deg_up_to_left_bank; - case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: - return lim_launched_rc_track_diag_25_deg_up_to_right_bank; - case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: - return lim_launched_rc_track_diag_left_bank_to_25_deg_down; - case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: - return lim_launched_rc_track_diag_right_bank_to_25_deg_down; - case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: - return lim_launched_rc_track_diag_25_deg_down_to_left_bank; - case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: - return lim_launched_rc_track_diag_25_deg_down_to_right_bank; - case TRACK_ELEM_DIAG_LEFT_BANK: - return lim_launched_rc_track_diag_left_bank; - case TRACK_ELEM_DIAG_RIGHT_BANK: - return lim_launched_rc_track_diag_right_bank; case TRACK_ELEM_90_DEG_TO_INVERTED_FLAT_QUARTER_LOOP_UP: return lim_launched_rc_track_90_deg_to_inverted_flat_quarter_loop_up; case TRACK_ELEM_INVERTED_FLAT_TO_90_DEG_QUARTER_LOOP_DOWN: return lim_launched_rc_track_inverted_flat_to_90_deg_quarter_loop_down; case TRACK_ELEM_BLOCK_BRAKES: return lim_launched_rc_track_block_brakes; - case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: - return lim_launched_rc_track_left_banked_quarter_turn_3_25_deg_up; - case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: - return lim_launched_rc_track_right_banked_quarter_turn_3_25_deg_up; - case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: - return lim_launched_rc_track_left_banked_quarter_turn_3_25_deg_down; - case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: - return lim_launched_rc_track_right_banked_quarter_turn_3_25_deg_down; - case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: - return lim_launched_rc_track_left_banked_quarter_turn_5_25_deg_up; - case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: - return lim_launched_rc_track_right_banked_quarter_turn_5_25_deg_up; - case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: - return lim_launched_rc_track_left_banked_quarter_turn_5_25_deg_down; - case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: - return lim_launched_rc_track_right_banked_quarter_turn_5_25_deg_down; - case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANKED_25_DEG_UP: - return lim_launched_rc_track_25_deg_up_to_left_banked_25_deg_up; - case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANKED_25_DEG_UP: - return lim_launched_rc_track_25_deg_up_to_right_banked_25_deg_up; - case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_25_DEG_UP: - return lim_launched_rc_track_left_banked_25_deg_up_to_25_deg_up; - case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_25_DEG_UP: - return lim_launched_rc_track_right_banked_25_deg_up_to_25_deg_up; - case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANKED_25_DEG_DOWN: - return lim_launched_rc_track_25_deg_down_to_left_banked_25_deg_down; - case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANKED_25_DEG_DOWN: - return lim_launched_rc_track_25_deg_down_to_right_banked_25_deg_down; - case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: - return lim_launched_rc_track_left_banked_25_deg_down_to_25_deg_down; - case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: - return lim_launched_rc_track_right_banked_25_deg_down_to_25_deg_down; - case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_UP: - return lim_launched_rc_track_left_banked_flat_to_left_banked_25_deg_up; - case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_UP: - return lim_launched_rc_track_right_banked_flat_to_right_banked_25_deg_up; - case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_LEFT_BANKED_FLAT: - return lim_launched_rc_track_left_banked_25_deg_up_to_left_banked_flat; - case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_RIGHT_BANKED_FLAT: - return lim_launched_rc_track_right_banked_25_deg_up_to_right_banked_flat; - case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: - return lim_launched_rc_track_left_banked_flat_to_left_banked_25_deg_down; - case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: - return lim_launched_rc_track_right_banked_flat_to_right_banked_25_deg_down; - case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_LEFT_BANKED_FLAT: - return lim_launched_rc_track_left_banked_25_deg_down_to_left_banked_flat; - case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_RIGHT_BANKED_FLAT: - return lim_launched_rc_track_right_banked_25_deg_down_to_right_banked_flat; - case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_UP: - return lim_launched_rc_track_flat_to_left_banked_25_deg_up; - case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_UP: - return lim_launched_rc_track_flat_to_right_banked_25_deg_up; - case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_FLAT: - return lim_launched_rc_track_left_banked_25_deg_up_to_flat; - case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_FLAT: - return lim_launched_rc_track_right_banked_25_deg_up_to_flat; - case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: - return lim_launched_rc_track_flat_to_left_banked_25_deg_down; - case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: - return lim_launched_rc_track_flat_to_right_banked_25_deg_down; - case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_FLAT: - return lim_launched_rc_track_left_banked_25_deg_down_to_flat; - case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_FLAT: - return lim_launched_rc_track_right_banked_25_deg_down_to_flat; case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_90_DEG_UP: return lim_launched_rc_track_left_quarter_turn_1_90_deg_up; case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_90_DEG_UP: From 8663125ac00d1351b44d8c7e15ae1359cef0daac Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 22:54:20 +0100 Subject: [PATCH 40/55] Fix looping roller coaster painting --- src/ride/coaster/looping_roller_coaster.c | 29 ++++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/ride/coaster/looping_roller_coaster.c b/src/ride/coaster/looping_roller_coaster.c index d92a700185..a627526606 100644 --- a/src/ride/coaster/looping_roller_coaster.c +++ b/src/ride/coaster/looping_roller_coaster.c @@ -66,6 +66,24 @@ static void looping_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 di paint_util_set_general_support_height(height + 32, 0x20); } +static void looping_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][2] = { + { 15016, SPR_STATION_BASE_B_SW_NE }, + { 15017, SPR_STATION_BASE_B_NW_SE }, + { 15016, SPR_STATION_BASE_B_SW_NE }, + { 15017, SPR_STATION_BASE_B_NW_SE }, + }; + + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); + sub_98196C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 0); + track_paint_util_draw_station(rideIndex, trackSequence, direction, height, 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 + 32, 0x20); +} + static void looping_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -2974,32 +2992,27 @@ static void looping_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15004, 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, gTrackColours[SCHEME_MISC] | 22432, 0, 0, 32, 32, 1, height); metal_a_supports_paint_setup(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15005, 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, gTrackColours[SCHEME_MISC] | 22432, 0, 0, 32, 32, 1, height); metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15004, 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, gTrackColours[SCHEME_MISC] | 22432, 0, 0, 32, 32, 1, height); metal_a_supports_paint_setup(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15005, 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_0); paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 48, 0x20); @@ -6171,6 +6184,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_looping_rc(int trackType, int dire switch (trackType) { case TRACK_ELEM_FLAT: return looping_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return looping_rc_track_station; case TRACK_ELEM_25_DEG_UP: return looping_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: From 4152b64a2aa7bcab7c37377fac02ef2bea88b0d6 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 22:56:45 +0100 Subject: [PATCH 41/55] Fix mine ride painting --- src/ride/coaster/mine_ride.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/ride/coaster/mine_ride.c b/src/ride/coaster/mine_ride.c index 258643a9aa..e2a0b4f8ac 100644 --- a/src/ride/coaster/mine_ride.c +++ b/src/ride/coaster/mine_ride.c @@ -49,6 +49,24 @@ static void mine_ride_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 dir paint_util_set_general_support_height(height + 32, 0x20); } +static void mine_ride_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { 19338, SPR_STATION_BASE_A_SW_NE }, + { 19339, SPR_STATION_BASE_A_NW_SE }, + { 19338, SPR_STATION_BASE_A_SW_NE }, + { 19339, SPR_STATION_BASE_A_NW_SE }, + }; + + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); + sub_98196C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 0); + track_paint_util_draw_station_2(rideIndex, trackSequence, direction, height, mapElement, 9, 11); + 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 mine_ride_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { switch (direction) { @@ -2017,32 +2035,27 @@ static void mine_ride_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, metal_a_supports_paint_setup(1, 5, 6, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19338, 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(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19339, 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(1, 5, 6, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19338, 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(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19339, 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); @@ -3553,6 +3566,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_mine_ride(int trackType, int direc switch (trackType) { case TRACK_ELEM_FLAT: return mine_ride_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return mine_ride_track_station; case TRACK_ELEM_25_DEG_UP: return mine_ride_track_25_deg_up; case TRACK_ELEM_FLAT_TO_25_DEG_UP: From 799788dfaafe140d6c9b458aba6371b0db5db2a1 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 23:08:54 +0100 Subject: [PATCH 42/55] Fix mine train roller coaster painting --- src/ride/coaster/mine_train_coaster.c | 31 +++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/src/ride/coaster/mine_train_coaster.c b/src/ride/coaster/mine_train_coaster.c index 9166e5d520..1c52737091 100644 --- a/src/ride/coaster/mine_train_coaster.c +++ b/src/ride/coaster/mine_train_coaster.c @@ -66,6 +66,28 @@ static void mine_train_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 paint_util_set_general_support_height(height + 32, 0x20); } +static void mine_train_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { 20064, 20060, SPR_STATION_BASE_B_SW_NE }, + { 20065, 20061, SPR_STATION_BASE_B_NW_SE }, + { 20064, 20060, SPR_STATION_BASE_B_SW_NE }, + { 20065, 20061, SPR_STATION_BASE_B_NW_SE }, + }; + + sub_98197C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_MISC], 0, 0, 32, 28, 1, height - 2, 0, 2, height); + if (mapElement->properties.track.type == TRACK_ELEM_END_STATION) { + sub_98199C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 0, height); + } else { + sub_98199C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 0, height); + } + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 3); + track_paint_util_draw_station(rideIndex, trackSequence, direction, height, 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 + 32, 0x20); +} + static void mine_train_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -2784,30 +2806,27 @@ static void mine_train_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequen wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25623, 26, 0, 1, 1, 19, height + 2); sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25623, 26, 31, 1, 1, 19, height + 2); - sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25617, 6, 0, 1, 1, 19, height + 2); break; case 1: sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20053, 0, 0, 32, 20, 1, height, 0, 6, height); wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25624, 6, 0, 1, 1, 19, height + 2); sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25624, 6, 31, 1, 1, 19, height + 2); - sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25618, 26, 0, 1, 1, 19, height + 2); break; case 2: sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20052, 0, 0, 32, 20, 1, height, 0, 6, height); wooden_a_supports_paint_setup(6, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25625, 6, 0, 1, 1, 19, height + 2); sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25625, 6, 31, 1, 1, 19, height + 2); - sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25615, 26, 31, 1, 1, 19, height + 2); break; case 3: sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 20053, 0, 0, 32, 20, 1, height, 0, 6, height); wooden_a_supports_paint_setup(7, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25626, 26, 0, 1, 1, 19, height + 2); sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25626, 26, 31, 1, 1, 19, height + 2); - sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 25616, 6, 31, 1, 1, 19, height + 2); break; } + 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); @@ -5355,6 +5374,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_mine_train_rc(int trackType, int d switch (trackType) { case TRACK_ELEM_FLAT: return mine_train_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return mine_train_rc_track_station; case TRACK_ELEM_25_DEG_UP: return mine_train_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: From 99ca532638e61743b498d038fbf5433b420aa09d Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 23:11:05 +0100 Subject: [PATCH 43/55] Fix mini roller coaster painting --- src/ride/coaster/mini_roller_coaster.c | 33 +++++++++++++++++++++----- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/ride/coaster/mini_roller_coaster.c b/src/ride/coaster/mini_roller_coaster.c index a31fc84808..830ff2e72e 100644 --- a/src/ride/coaster/mini_roller_coaster.c +++ b/src/ride/coaster/mini_roller_coaster.c @@ -78,6 +78,28 @@ static void mini_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direc paint_util_set_general_support_height(height + 32, 0x20); } +static void mini_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { 18746, 18742, SPR_STATION_BASE_A_SW_NE }, + { 18747, 18743, SPR_STATION_BASE_A_NW_SE }, + { 18746, 18742, SPR_STATION_BASE_A_SW_NE }, + { 18747, 18743, SPR_STATION_BASE_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, 20, 1, height, 0, 6, height + 3); + } else { + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); + } + sub_98196C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 0); + track_paint_util_draw_station_2(rideIndex, trackSequence, direction, height, mapElement, 9, 11); + 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 mini_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -2842,32 +2864,27 @@ static void mini_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, ui metal_a_supports_paint_setup(1, 5, 6, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18738, 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(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18739, 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(1, 5, 6, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18738, 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(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18739, 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); @@ -5929,6 +5946,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_mini_rc(int trackType, int directi switch (trackType) { case TRACK_ELEM_FLAT: return mini_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return mini_rc_track_station; case TRACK_ELEM_25_DEG_UP: return mini_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: From e5a662440f18aaf740c54b125a4a298264be2049 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 23:17:00 +0100 Subject: [PATCH 44/55] Fix mini suspended coaster painting --- src/ride/coaster/mini_suspended_coaster.c | 23 +++++++++++++++++++++++ src/ride/track_paint.h | 3 +++ 2 files changed, 26 insertions(+) diff --git a/src/ride/coaster/mini_suspended_coaster.c b/src/ride/coaster/mini_suspended_coaster.c index e7c3b8b020..7d651f8b14 100644 --- a/src/ride/coaster/mini_suspended_coaster.c +++ b/src/ride/coaster/mini_suspended_coaster.c @@ -68,6 +68,25 @@ static void mini_suspended_rc_track_flat(uint8 rideIndex, uint8 trackSequence, u paint_util_set_general_support_height(height + 48, 0x20); } +static void mini_suspended_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { SPR_STATION_BASE_C_SW_NE, 28433, SPR_STATION_INVERTED_BAR_E_SW_NE }, + { SPR_STATION_BASE_C_NW_SE, 28434, SPR_STATION_INVERTED_BAR_E_NW_SE }, + { SPR_STATION_BASE_C_SW_NE, 28433, SPR_STATION_INVERTED_BAR_E_SW_NE }, + { SPR_STATION_BASE_C_NW_SE, 28434, SPR_STATION_INVERTED_BAR_E_NW_SE }, + }; + + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_MISC], 0, 0, 32, 28, 1, height, 0, 2, height); + sub_98196C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_TRACK], 0, 6, 32, 20, 1, height + 24); + sub_98199C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 1, height + 24, 0, 2, height); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 3); + track_paint_util_draw_station_inverted(rideIndex, trackSequence, direction, height, 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 + 32, 0x20); +} + static void mini_suspended_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -1559,6 +1578,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_mini_suspended_rc(int trackType, i switch (trackType) { case TRACK_ELEM_FLAT: return mini_suspended_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return mini_suspended_rc_track_station; case TRACK_ELEM_25_DEG_UP: return mini_suspended_rc_track_25_deg_up; case TRACK_ELEM_FLAT_TO_25_DEG_UP: diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index bbe33ccfc8..e663add740 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -128,6 +128,9 @@ enum { SPR_STATION_INVERTED_BAR_C_SW_NE = 22398, SPR_STATION_INVERTED_BAR_C_NW_SE = 22399, + SPR_STATION_INVERTED_BAR_E_SW_NE = 22402, + SPR_STATION_INVERTED_BAR_E_NW_SE = 22403, + SPR_STATION_PIER_EDGE_SE = 22404, SPR_STATION_PIER_EDGE_SW = 22405, SPR_STATION_PIER_EDGE_NW = 22406, From 83dcff66b6fe103934e3be2e4cc5ece6317cf7a9 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 23:28:27 +0100 Subject: [PATCH 45/55] Fix multi-dimension roller coaster painting --- .../coaster/multi_dimension_roller_coaster.c | 53 ++++++++++++++----- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/src/ride/coaster/multi_dimension_roller_coaster.c b/src/ride/coaster/multi_dimension_roller_coaster.c index f226ad9604..5263a39f72 100644 --- a/src/ride/coaster/multi_dimension_roller_coaster.c +++ b/src/ride/coaster/multi_dimension_roller_coaster.c @@ -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: From 5de60f193436f0d4ff5dd6b3869608046e751ef5 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 23:33:32 +0100 Subject: [PATCH 46/55] Fix reverser roller coaster painting --- src/ride/coaster/reverser_roller_coaster.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/ride/coaster/reverser_roller_coaster.c b/src/ride/coaster/reverser_roller_coaster.c index 251697f025..8efc597d44 100644 --- a/src/ride/coaster/reverser_roller_coaster.c +++ b/src/ride/coaster/reverser_roller_coaster.c @@ -79,6 +79,24 @@ static void reverser_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 d paint_util_set_general_support_height(height + 32, 0x20); } +static void reverser_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { 21506, SPR_STATION_BASE_A_SW_NE }, + { 21507, SPR_STATION_BASE_A_NW_SE }, + { 21506, SPR_STATION_BASE_A_SW_NE }, + { 21507, SPR_STATION_BASE_A_NW_SE }, + }; + + sub_98197C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_MISC], 0, 0, 32, 27, 2, height, 0, 2, height); + sub_98199C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(direction & 1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + track_paint_util_draw_station_2(rideIndex, trackSequence, direction, height, mapElement, 9, 11); + 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 reverser_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -1005,6 +1023,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_reverser_rc(int trackType, int dir switch (trackType) { case TRACK_ELEM_FLAT: return reverser_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return reverser_rc_track_station; case TRACK_ELEM_25_DEG_UP: return reverser_rc_track_25_deg_up; case TRACK_ELEM_FLAT_TO_25_DEG_UP: From 1b351240cb3c009678d2dd25985f60f88baa20a7 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 23:37:05 +0100 Subject: [PATCH 47/55] Fix side friction roller coaster painting --- .../coaster/side_friction_roller_coaster.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/ride/coaster/side_friction_roller_coaster.c b/src/ride/coaster/side_friction_roller_coaster.c index 99267cffe4..1e0df2228a 100644 --- a/src/ride/coaster/side_friction_roller_coaster.c +++ b/src/ride/coaster/side_friction_roller_coaster.c @@ -72,6 +72,23 @@ static void side_friction_rc_track_flat(uint8 rideIndex, uint8 trackSequence, ui paint_util_set_general_support_height(height + 32, 0x20); } +static void side_friction_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4] = { + 21610, + 21611, + 21610, + 21611, + }; + + sub_98197C_rotated(direction, imageIds[direction] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 27, 2, height, 0, 2, height); + wooden_a_supports_paint_setup(direction & 1, 0, height, gTrackColours[SCHEME_SUPPORTS], NULL); + track_paint_util_draw_station_2(rideIndex, trackSequence, direction, height, mapElement, 9, 11); + 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 side_friction_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -1882,6 +1899,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_side_friction_rc(int trackType, in switch (trackType) { case TRACK_ELEM_FLAT: return side_friction_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return side_friction_rc_track_station; case TRACK_ELEM_25_DEG_UP: return side_friction_rc_track_25_deg_up; case TRACK_ELEM_FLAT_TO_25_DEG_UP: From 3f568fac55381da78ebf425048de27e1ebce425a Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 23:41:54 +0100 Subject: [PATCH 48/55] Fix spiral roller coaster painting --- src/ride/coaster/spiral_roller_coaster.c | 6102 +--------------------- 1 file changed, 40 insertions(+), 6062 deletions(-) diff --git a/src/ride/coaster/spiral_roller_coaster.c b/src/ride/coaster/spiral_roller_coaster.c index 7d08f66e18..7c0d0bafea 100644 --- a/src/ride/coaster/spiral_roller_coaster.c +++ b/src/ride/coaster/spiral_roller_coaster.c @@ -26,4969 +26,6 @@ #include "../track_data.h" #include "../track_paint.h" -static void spiral_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19044, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19045, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19046, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19047, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - } else { - switch (direction) { - case 0: - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18738, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18739, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - } - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); -} - -static void spiral_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19056, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19057, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19058, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19059, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18796, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18797, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18798, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18799, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); -} - -static void spiral_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18812, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 38, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18813, 0, 0, 32, 1, 98, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 38, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18814, 0, 0, 32, 1, 98, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 38, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18815, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 38, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } else { - paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); -} - -static void spiral_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19048, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19049, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19050, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19051, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18788, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18789, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18790, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18791, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } else { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); -} - -static void spiral_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18800, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 18, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18801, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18804, 0, 0, 32, 1, 66, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 18, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18802, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18805, 0, 0, 32, 1, 66, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 18, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18803, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 18, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } else { - paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); -} - -static void spiral_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18806, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 26, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18807, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18810, 0, 0, 32, 1, 66, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 26, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18808, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18811, 0, 0, 32, 1, 66, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 26, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18809, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 26, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } else { - paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); -} - -static void spiral_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19052, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19053, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19054, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19055, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18792, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18793, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18794, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18795, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 40, 0x20); -} - -static void spiral_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18851, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18856, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18861, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18846, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18850, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18855, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18860, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18845, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18849, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18854, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18859, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18844, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 5: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18848, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18853, 0, 0, 16, 32, 3, height, 0, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18858, 0, 0, 16, 32, 3, height, 0, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18843, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18847, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18852, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18857, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18842, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 2: - paint_util_push_tunnel_right(height, TUNNEL_6); - break; - case 3: - paint_util_push_tunnel_left(height, TUNNEL_6); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - spiral_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void spiral_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18748, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18756, 0, 0, 32, 1, 26, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18749, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18757, 0, 0, 32, 1, 26, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18750, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18751, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); -} - -static void spiral_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18752, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18753, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18754, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18758, 0, 0, 32, 1, 26, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18755, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18759, 0, 0, 32, 1, 26, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); -} - -static void spiral_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18754, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18758, 0, 0, 32, 1, 26, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18755, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18759, 0, 0, 32, 1, 26, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18752, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18753, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); -} - -static void spiral_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18750, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18751, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18748, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18756, 0, 0, 32, 1, 26, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18749, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18757, 0, 0, 32, 1, 26, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); -} - -static void spiral_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18871, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18882, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18876, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18881, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18866, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18870, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18875, 0, 0, 32, 16, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18880, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18865, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18869, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18874, 0, 0, 16, 16, 1, height, 16, 16, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18879, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18864, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 5: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18868, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18873, 0, 0, 16, 32, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18878, 0, 0, 16, 32, 3, height, 0, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18863, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18867, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18872, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18877, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18883, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18862, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 2: - paint_util_push_tunnel_right(height, TUNNEL_6); - break; - case 3: - paint_util_push_tunnel_left(height, TUNNEL_6); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - spiral_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void spiral_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18760, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18764, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18761, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18765, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18762, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18763, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } else { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); -} - -static void spiral_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18766, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18767, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18768, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18770, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18769, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18771, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } else { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); -} - -static void spiral_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18772, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18776, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18773, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18777, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18774, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18775, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 40, 0x20); -} - -static void spiral_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18778, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18779, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18780, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18782, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18781, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18783, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 40, 0x20); -} - -static void spiral_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18784, 0, 0, 32, 1, 26, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18785, 0, 0, 32, 1, 26, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18786, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18787, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); -} - -static void spiral_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18936, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18941, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18946, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18951, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18937, 0, 0, 32, 16, 3, height); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18942, 0, 0, 32, 16, 3, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18947, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18952, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18938, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18943, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18948, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18953, 0, 0, 16, 16, 3, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 64, 0x20); - break; - case 4: - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 5: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18939, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18944, 0, 0, 16, 32, 3, height); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18949, 0, 0, 16, 32, 3, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18954, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18940, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18945, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18950, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18955, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 2: - paint_util_push_tunnel_right(height + 8, TUNNEL_8); - break; - case 3: - paint_util_push_tunnel_left(height + 8, TUNNEL_8); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void spiral_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18916, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18921, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18926, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18931, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18917, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18922, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18927, 0, 0, 32, 16, 3, height); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18932, 0, 0, 32, 16, 3, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18918, 0, 0, 16, 16, 3, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18923, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18928, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18933, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 64, 0x20); - break; - case 4: - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 5: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18919, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18924, 0, 0, 16, 32, 3, height); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18929, 0, 0, 16, 32, 3, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18934, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18920, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18925, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18930, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18935, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 0: - paint_util_push_tunnel_right(height + 8, TUNNEL_8); - break; - case 1: - paint_util_push_tunnel_left(height + 8, TUNNEL_8); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void spiral_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - spiral_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); -} - -static void spiral_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - spiral_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void spiral_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18900, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18904, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18903, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18907, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18901, 0, 0, 32, 26, 3, height); - metal_a_supports_paint_setup(1, 5, 3, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18905, 0, 0, 32, 26, 3, height); - metal_a_supports_paint_setup(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18902, 0, 0, 32, 26, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18906, 0, 0, 32, 26, 3, height, 0, 6, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18902, 0, 0, 32, 26, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18906, 0, 0, 32, 26, 3, height, 0, 6, height); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18901, 0, 0, 32, 26, 3, height); - metal_a_supports_paint_setup(1, 5, 3, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18905, 0, 0, 32, 26, 3, height); - metal_a_supports_paint_setup(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18903, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18907, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18900, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18904, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 1: - paint_util_push_tunnel_right(height, TUNNEL_6); - break; - case 2: - paint_util_push_tunnel_left(height, TUNNEL_6); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18908, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18912, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18911, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18915, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18909, 0, 0, 32, 26, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18913, 0, 0, 32, 26, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18910, 0, 0, 32, 26, 3, height); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18914, 0, 0, 32, 26, 3, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18910, 0, 0, 32, 26, 3, height); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18914, 0, 0, 32, 26, 3, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18909, 0, 0, 32, 26, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18913, 0, 0, 32, 26, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18911, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18915, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18908, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18912, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 1: - paint_util_push_tunnel_right(height, TUNNEL_6); - break; - case 2: - paint_util_push_tunnel_left(height, TUNNEL_6); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18821, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18824, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18827, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18818, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18820, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18823, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18826, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18817, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18819, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18822, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18825, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18816, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 2: - paint_util_push_tunnel_right(height, TUNNEL_6); - break; - case 3: - paint_util_push_tunnel_left(height, TUNNEL_6); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - spiral_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void spiral_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18833, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18840, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18836, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18839, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18830, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18832, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18835, 0, 0, 16, 16, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18838, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18829, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18831, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18834, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18837, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18841, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18828, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 2: - paint_util_push_tunnel_right(height, TUNNEL_6); - break; - case 3: - paint_util_push_tunnel_left(height, TUNNEL_6); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - spiral_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void spiral_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18967, 0, 6, 32, 20, 3, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18969, 0, 6, 32, 20, 3, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18971, 0, 6, 32, 20, 3, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18965, 0, 6, 32, 20, 3, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18966, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18968, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18970, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18964, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 2: - paint_util_push_tunnel_right(height + 8, TUNNEL_8); - break; - case 3: - paint_util_push_tunnel_left(height + 8, TUNNEL_8); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void spiral_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18956, 0, 6, 32, 20, 3, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18958, 0, 6, 32, 20, 3, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18960, 0, 6, 32, 20, 3, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18962, 0, 6, 32, 20, 3, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18957, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18959, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18961, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(2, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18963, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 0: - paint_util_push_tunnel_right(height + 8, TUNNEL_8); - break; - case 1: - paint_util_push_tunnel_left(height + 8, TUNNEL_8); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void spiral_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - spiral_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); -} - -static void spiral_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - spiral_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void spiral_rc_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18991, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18998, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18994, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18997, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18988, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18990, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18993, 0, 0, 16, 16, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18996, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18987, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18989, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18992, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18995, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18999, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(2, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18986, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 2: - paint_util_push_tunnel_right(height + 8, TUNNEL_6); - break; - case 3: - paint_util_push_tunnel_left(height + 8, TUNNEL_6); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18988, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18991, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18998, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18994, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18997, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 0: - paint_util_push_tunnel_right(height, TUNNEL_6); - break; - case 1: - paint_util_push_tunnel_left(height, TUNNEL_6); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 5: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18987, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18990, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18993, 0, 0, 16, 16, 1, height, 0, 0, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18996, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 7: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18986, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18989, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18992, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18995, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18999, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(2, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18972, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18975, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18978, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18981, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18985, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(2, 4, 11, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18973, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18976, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18979, 0, 0, 16, 16, 1, height, 0, 0, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18982, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18974, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18977, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18984, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(1, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18980, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18983, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 0: - paint_util_push_tunnel_right(height + 8, TUNNEL_6); - break; - case 1: - paint_util_push_tunnel_left(height + 8, TUNNEL_6); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18975, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18978, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18981, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18985, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(2, 4, 11, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18972, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 2: - paint_util_push_tunnel_right(height, TUNNEL_6); - break; - case 3: - paint_util_push_tunnel_left(height, TUNNEL_6); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 5: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18976, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18979, 0, 0, 16, 16, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18982, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18973, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 7: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18977, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18984, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(1, 4, 15, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18980, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18983, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18974, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (trackSequence >= 4) { - trackSequence -= 4; - direction = (direction - 1) & 3; - } - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - spiral_rc_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); -} - -static void spiral_rc_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (trackSequence >= 4) { - trackSequence -= 4; - direction = (direction + 1) & 3; - } - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - spiral_rc_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void spiral_rc_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19031, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19042, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19036, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19041, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19026, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19030, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19035, 0, 0, 32, 16, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19040, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19025, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19029, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19034, 0, 0, 16, 16, 1, height, 16, 16, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19039, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19024, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 5: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19028, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19033, 0, 0, 16, 32, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19038, 0, 0, 16, 32, 3, height, 0, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19023, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19027, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19032, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19037, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19043, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19022, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 2: - paint_util_push_tunnel_right(height + 8, TUNNEL_6); - break; - case 3: - paint_util_push_tunnel_left(height + 8, TUNNEL_6); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 7: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19026, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19031, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19042, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19036, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19041, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 0: - paint_util_push_tunnel_right(height, TUNNEL_6); - break; - case 1: - paint_util_push_tunnel_left(height, TUNNEL_6); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 8: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 9: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19025, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19030, 0, 0, 16, 32, 3, height, 0, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19035, 0, 0, 16, 32, 1, height, 0, 0, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19040, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 10: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19024, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19029, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19034, 0, 0, 16, 16, 1, height, 16, 16, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19039, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 11: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 12: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19023, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19028, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19033, 0, 0, 32, 16, 1, height, 0, 0, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19038, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 13: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19022, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19027, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19032, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19037, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19043, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19000, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19005, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19010, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19015, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19021, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19001, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19006, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19011, 0, 0, 32, 16, 1, height, 0, 0, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19016, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19002, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19007, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19012, 0, 0, 16, 16, 1, height, 16, 16, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19017, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 5: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19003, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19008, 0, 0, 16, 32, 3, height, 0, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19013, 0, 0, 16, 32, 1, height, 0, 0, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19018, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19004, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19009, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19020, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19014, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19019, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 0: - paint_util_push_tunnel_right(height + 8, TUNNEL_6); - break; - case 1: - paint_util_push_tunnel_left(height + 8, TUNNEL_6); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 7: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19005, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19010, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19015, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19021, 0, 0, 1, 32, 26, height, 27, 0, height); - metal_a_supports_paint_setup(2, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19000, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 2: - paint_util_push_tunnel_right(height, TUNNEL_6); - break; - case 3: - paint_util_push_tunnel_left(height, TUNNEL_6); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 8: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 9: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19006, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19011, 0, 0, 16, 32, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19016, 0, 0, 16, 32, 3, height, 0, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19001, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 10: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19007, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19012, 0, 0, 16, 16, 1, height, 16, 16, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19017, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19002, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 11: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 12: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19008, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19013, 0, 0, 32, 16, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19018, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19003, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 13: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19009, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19020, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19014, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19019, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19004, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 13, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (trackSequence >= 7) { - trackSequence -= 7; - direction = (direction - 1) & 3; - } - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - spiral_rc_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); -} - -static void spiral_rc_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (trackSequence >= 7) { - trackSequence -= 7; - direction = (direction + 1) & 3; - } - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - spiral_rc_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void spiral_rc_track_left_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18893, 0, 0, 28, 28, 3, height, 2, 2, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18897, 0, 0, 28, 28, 1, height, 2, 2, height + 99); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18894, 0, 0, 28, 28, 3, height, 2, 2, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18898, 0, 0, 28, 28, 1, height, 2, 2, height + 99); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18895, 0, 0, 28, 28, 3, height, 2, 2, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18899, 0, 0, 28, 28, 1, height, 2, 2, height + 99); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18892, 0, 0, 28, 28, 3, height, 2, 2, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18896, 0, 0, 28, 28, 1, height, 2, 2, height + 99); - break; - } - switch (direction) { - case 0: - paint_util_push_tunnel_left(height - 8, TUNNEL_8); - break; - case 2: - paint_util_push_tunnel_right(height + 56, TUNNEL_7); - break; - case 3: - paint_util_push_tunnel_right(height - 8, TUNNEL_7); - paint_util_push_tunnel_left(height + 56, TUNNEL_7); - break; - } - paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); -} - -static void spiral_rc_track_right_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18884, 0, 0, 28, 28, 3, height, 2, 2, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18888, 0, 0, 28, 28, 1, height, 2, 2, height + 99); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18885, 0, 0, 28, 28, 3, height, 2, 2, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18889, 0, 0, 28, 28, 1, height, 2, 2, height + 99); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18886, 0, 0, 28, 28, 3, height, 2, 2, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18890, 0, 0, 28, 28, 1, height, 2, 2, height + 99); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18887, 0, 0, 28, 28, 3, height, 2, 2, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18891, 0, 0, 28, 28, 1, height, 2, 2, height + 99); - break; - } - switch (direction) { - case 0: - paint_util_push_tunnel_right(height + 56, TUNNEL_7); - paint_util_push_tunnel_left(height - 8, TUNNEL_7); - break; - case 1: - paint_util_push_tunnel_left(height + 56, TUNNEL_8); - break; - case 3: - paint_util_push_tunnel_right(height - 8, TUNNEL_7); - break; - } - paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); -} - -static void spiral_rc_track_left_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_right_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); -} - -static void spiral_rc_track_right_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_left_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void spiral_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18740, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18741, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); -} - -static void spiral_rc_track_25_deg_up_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19222, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19223, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19224, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19225, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); -} - -static void spiral_rc_track_25_deg_up_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19226, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19227, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19228, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19229, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); -} - -static void spiral_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98196C_rotated(direction, 0x20000000 | 22432, 0, 0, 32, 32, 1, height); - metal_a_supports_paint_setup(1, 5, 6, height, gTrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18738, 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(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18739, 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(1, 5, 6, height, gTrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(1, 8, 6, height, gTrackColours[SCHEME_SUPPORTS]); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18738, 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(2, 6, 6, height, gTrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(2, 7, 6, height, gTrackColours[SCHEME_SUPPORTS]); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18739, 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); - 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); -} - -static void spiral_rc_track_25_deg_down_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_25_deg_up_right_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_25_deg_down_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_25_deg_up_left_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19076, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19080, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19084, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19088, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19077, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19081, 0, 0, 34, 16, 3, height, 0, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19085, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19089, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19078, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19082, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19086, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19090, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19079, 0, 0, 16, 16, 3, height, 16, 16, height); - metal_a_supports_paint_setup(1, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19083, 0, 0, 16, 18, 3, height, 0, 16, height); - metal_a_supports_paint_setup(2, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19087, 0, 0, 16, 16, 3, height, 0, 0, height); - metal_a_supports_paint_setup(1, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19091, 0, 0, 16, 16, 3, height, 16, 0, height); - metal_a_supports_paint_setup(2, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19060, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19064, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19068, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19072, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19061, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19065, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19069, 0, 0, 34, 16, 3, height, 0, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19073, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19062, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19066, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19070, 0, 0, 28, 28, 3, height, 4, 4, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19074, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19063, 0, 0, 16, 16, 3, height, 16, 0, height); - metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19067, 0, 0, 16, 16, 3, height, 0, 0, height); - metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19071, 0, 0, 16, 18, 3, height, 0, 16, height); - metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19075, 0, 0, 16, 16, 3, height, 16, 16, height); - metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - spiral_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - spiral_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); -} - -static void spiral_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19108, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19112, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19116, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19120, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19109, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19113, 0, 0, 34, 16, 0, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19117, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19121, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19110, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19114, 0, 0, 16, 16, 0, height, 16, 16, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19118, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19122, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19111, 0, 0, 16, 16, 3, height, 16, 16, height); - metal_a_supports_paint_setup(1, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19115, 0, 0, 16, 18, 0, height, 0, 16, height + 27); - metal_a_supports_paint_setup(2, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19119, 0, 0, 16, 16, 3, height, 0, 0, height); - metal_a_supports_paint_setup(1, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19123, 0, 0, 16, 16, 3, height, 16, 0, height); - metal_a_supports_paint_setup(2, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19092, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19096, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19100, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19104, 0, 0, 32, 1, 26, height, 0, 27, height); - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19093, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19097, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19101, 0, 0, 34, 16, 0, height, 0, 0, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19105, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19094, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19098, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19102, 0, 0, 28, 28, 0, height, 4, 4, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19106, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19095, 0, 0, 16, 16, 3, height, 16, 0, height); - metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19099, 0, 0, 16, 16, 3, height, 0, 0, height); - metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19103, 0, 0, 16, 18, 0, height, 0, 16, height + 27); - metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19107, 0, 0, 16, 16, 3, height, 16, 16, height); - metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - spiral_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - spiral_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); -} - -static void spiral_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19189, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19127, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19186, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19124, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19188, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19126, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19187, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19125, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19201, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19139, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19198, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19136, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19200, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19138, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19199, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19137, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - } -} - -static void spiral_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19151, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19148, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19150, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 38, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19149, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 42, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 38, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 42, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); - break; - } -} - -static void spiral_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19193, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19131, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19190, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19128, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19192, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19130, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19191, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19129, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - } -} - -static void spiral_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19143, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19140, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19142, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 22, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19141, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 22, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 22, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 22, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void spiral_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19147, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19144, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19146, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 27, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19145, -16, -16, 16, 16, 3, height, 0, 0, height); - metal_b_supports_paint_setup(2, 0, 27, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 27, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 27, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void spiral_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19197, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19135, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19194, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19132, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19196, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19134, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19195, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19133, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - } -} - -static void spiral_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19199, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19137, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19200, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19138, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19198, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19136, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19201, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19139, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - } -} - -static void spiral_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19149, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19150, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19148, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 30, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19151, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 34, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 30, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 34, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); - break; - } -} - -static void spiral_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19195, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19133, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19196, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19134, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19194, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19132, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19197, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19135, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - } -} - -static void spiral_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19145, -16, -16, 16, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19146, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19144, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 23, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19147, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 23, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 23, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 23, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void spiral_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19141, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19142, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19140, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19143, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void spiral_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19191, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19129, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19192, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19130, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19190, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19128, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19193, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19131, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - } -} - -static void spiral_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19159, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19156, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19160, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19158, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19157, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19164, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19161, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19163, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19165, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19162, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19162, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19163, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19165, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19161, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19164, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19157, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19158, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19156, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19160, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19159, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19179, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19176, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19180, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19178, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19177, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - } -} - -static void spiral_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19184, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19181, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19183, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19185, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19182, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - } -} - -static void spiral_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19169, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19166, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19170, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19168, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19167, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - } -} - -static void spiral_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19174, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19171, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19173, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19175, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19172, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - } -} - -static void spiral_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19172, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19173, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19175, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19171, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19174, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - } -} - -static void spiral_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19167, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19168, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19166, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19170, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19169, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - } -} - -static void spiral_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19182, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19183, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19185, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19181, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19184, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - } -} - -static void spiral_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19177, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19178, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19176, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19180, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19179, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - } -} - -static void spiral_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19155, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19152, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19154, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19153, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void spiral_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19153, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19154, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19152, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_a_supports_paint_setup(1, 1, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19155, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_a_supports_paint_setup(2, 0, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_a_supports_paint_setup(1, 2, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_a_supports_paint_setup(2, 3, 6, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - static void spiral_rc_track_left_curved_lift_hill(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { switch (trackSequence) { @@ -5123,1210 +160,151 @@ static void spiral_rc_track_right_curved_lift_hill(uint8 rideIndex, uint8 trackS } } -static void spiral_rc_track_block_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18742, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 18743, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); -} - -static void spiral_rc_track_left_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19317, 0, 6, 32, 20, 3, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19319, 0, 6, 32, 1, 34, height, 0, 27, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19321, 0, 6, 32, 20, 3, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19315, 0, 6, 32, 20, 3, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19316, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19318, 6, 0, 1, 32, 34, height, 27, 0, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19320, 6, 0, 1, 32, 34, height, 27, 0, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19314, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 2: - paint_util_push_tunnel_right(height + 8, TUNNEL_8); - break; - case 3: - paint_util_push_tunnel_left(height + 8, TUNNEL_8); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void spiral_rc_track_right_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19306, 0, 6, 32, 20, 3, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19308, 0, 6, 32, 20, 3, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19310, 0, 6, 32, 1, 34, height, 0, 27, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19312, 0, 6, 32, 20, 3, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19307, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19309, 6, 0, 1, 32, 34, height, 27, 0, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19311, 6, 0, 1, 32, 34, height, 27, 0, height); - metal_a_supports_paint_setup(2, 4, 16, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19313, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 0: - paint_util_push_tunnel_right(height + 8, TUNNEL_8); - break; - case 1: - paint_util_push_tunnel_left(height + 8, TUNNEL_8); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void spiral_rc_track_left_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - spiral_rc_track_right_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); -} - -static void spiral_rc_track_right_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - spiral_rc_track_left_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void spiral_rc_track_left_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19286, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19291, 0, 0, 32, 1, 34, height, 0, 27, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19296, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19301, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19287, 0, 0, 32, 16, 3, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19292, 0, 0, 1, 1, 34, height, 30, 30, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19297, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19302, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19288, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19293, 0, 0, 1, 1, 34, height, 30, 30, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19298, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19303, 0, 0, 16, 16, 3, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 64, 0x20); - break; - case 4: - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 5: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19289, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19294, 0, 0, 1, 1, 34, height, 30, 30, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19299, 0, 0, 1, 32, 34, height, 27, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19304, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19290, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19295, 0, 0, 1, 32, 34, height, 27, 0, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19300, 0, 0, 1, 32, 34, height, 27, 0, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19305, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 2: - paint_util_push_tunnel_right(height + 8, TUNNEL_8); - break; - case 3: - paint_util_push_tunnel_left(height + 8, TUNNEL_8); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void spiral_rc_track_right_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19266, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19271, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19276, 0, 0, 32, 1, 34, height, 0, 27, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19281, 0, 0, 32, 20, 3, height, 0, 6, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19267, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19272, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19277, 0, 0, 1, 1, 34, height, 30, 30, height); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19282, 0, 0, 32, 16, 3, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19268, 0, 0, 16, 16, 3, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19273, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19278, 0, 0, 1, 1, 34, height, 30, 30, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19283, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 64, 0x20); - break; - case 4: - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 5: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19269, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19274, 0, 0, 1, 32, 34, height, 27, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19279, 0, 0, 1, 1, 34, height, 30, 30, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19284, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19270, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19275, 0, 0, 1, 32, 34, height, 27, 0, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19280, 0, 0, 1, 32, 34, height, 27, 0, height); - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19285, 0, 0, 20, 32, 3, height, 6, 0, height); - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 0: - paint_util_push_tunnel_right(height + 8, TUNNEL_8); - break; - case 1: - paint_util_push_tunnel_left(height + 8, TUNNEL_8); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void spiral_rc_track_left_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - spiral_rc_track_right_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); -} - -static void spiral_rc_track_right_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - spiral_rc_track_left_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void spiral_rc_track_25_deg_up_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19230, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19231, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19238, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19232, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19233, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); -} - -static void spiral_rc_track_25_deg_up_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19234, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19235, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19236, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19239, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19237, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); -} - -static void spiral_rc_track_left_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19240, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19241, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19248, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19242, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19243, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); -} - -static void spiral_rc_track_right_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19244, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19245, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19246, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19249, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19247, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 14, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_7); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); -} - -static void spiral_rc_track_25_deg_down_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_right_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_25_deg_down_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_left_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_left_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_25_deg_up_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_right_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_25_deg_up_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_left_banked_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19250, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19251, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19252, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19253, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } else { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); -} - -static void spiral_rc_track_right_banked_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19254, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19255, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19256, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19257, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } else { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); -} - -static void spiral_rc_track_left_banked_25_deg_up_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19258, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19259, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19260, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19261, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 40, 0x20); -} - -static void spiral_rc_track_right_banked_25_deg_up_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19262, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19263, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19264, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19265, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 40, 0x20); -} - -static void spiral_rc_track_left_banked_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_right_banked_25_deg_up_to_right_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_right_banked_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_left_banked_25_deg_up_to_left_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_left_banked_25_deg_down_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_right_banked_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_right_banked_25_deg_down_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_left_banked_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19202, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19203, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19210, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19204, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19205, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } else { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); -} - -static void spiral_rc_track_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19206, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19207, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19208, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19211, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19209, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 9, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_6); - } else { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_8); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); -} - -static void spiral_rc_track_left_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19212, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19213, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19220, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19214, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19215, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 40, 0x20); -} - -static void spiral_rc_track_right_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19216, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19217, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19218, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19221, 0, 0, 32, 1, 34, height, 0, 27, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(1, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 19219, 0, 0, 32, 20, 3, height, 0, 6, height); - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(2, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - break; - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_6); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_14); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 40, 0x20); -} - -static void spiral_rc_track_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_right_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_left_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_left_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void spiral_rc_track_right_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - spiral_rc_track_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - TRACK_PAINT_FUNCTION get_track_paint_function_spiral_rc(int trackType, int direction) { switch (trackType) { + + // Use Mini Roller Coaster case TRACK_ELEM_FLAT: - return spiral_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: case TRACK_ELEM_25_DEG_UP: - return spiral_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: - return spiral_rc_track_60_deg_up; case TRACK_ELEM_FLAT_TO_25_DEG_UP: - return spiral_rc_track_flat_to_25_deg_up; case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: - return spiral_rc_track_25_deg_up_to_60_deg_up; case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: - return spiral_rc_track_60_deg_up_to_25_deg_up; case TRACK_ELEM_25_DEG_UP_TO_FLAT: - return spiral_rc_track_25_deg_up_to_flat; case TRACK_ELEM_25_DEG_DOWN: - return spiral_rc_track_25_deg_down; case TRACK_ELEM_60_DEG_DOWN: - return spiral_rc_track_60_deg_down; case TRACK_ELEM_FLAT_TO_25_DEG_DOWN: - return spiral_rc_track_flat_to_25_deg_down; case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: - return spiral_rc_track_25_deg_down_to_60_deg_down; case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: - return spiral_rc_track_60_deg_down_to_25_deg_down; case TRACK_ELEM_25_DEG_DOWN_TO_FLAT: - return spiral_rc_track_25_deg_down_to_flat; case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES: - return spiral_rc_track_left_quarter_turn_5; case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES: - return spiral_rc_track_right_quarter_turn_5; case TRACK_ELEM_FLAT_TO_LEFT_BANK: - return spiral_rc_track_flat_to_left_bank; case TRACK_ELEM_FLAT_TO_RIGHT_BANK: - return spiral_rc_track_flat_to_right_bank; case TRACK_ELEM_LEFT_BANK_TO_FLAT: - return spiral_rc_track_left_bank_to_flat; case TRACK_ELEM_RIGHT_BANK_TO_FLAT: - return spiral_rc_track_right_bank_to_flat; case TRACK_ELEM_BANKED_LEFT_QUARTER_TURN_5_TILES: - return spiral_rc_track_banked_left_quarter_turn_5; case TRACK_ELEM_BANKED_RIGHT_QUARTER_TURN_5_TILES: - return spiral_rc_track_banked_right_quarter_turn_5; case TRACK_ELEM_LEFT_BANK_TO_25_DEG_UP: - return spiral_rc_track_left_bank_to_25_deg_up; case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_UP: - return spiral_rc_track_right_bank_to_25_deg_up; case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANK: - return spiral_rc_track_25_deg_up_to_left_bank; case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANK: - return spiral_rc_track_25_deg_up_to_right_bank; case TRACK_ELEM_LEFT_BANK_TO_25_DEG_DOWN: - return spiral_rc_track_left_bank_to_25_deg_down; case TRACK_ELEM_RIGHT_BANK_TO_25_DEG_DOWN: - return spiral_rc_track_right_bank_to_25_deg_down; case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANK: - return spiral_rc_track_25_deg_down_to_left_bank; case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANK: - return spiral_rc_track_25_deg_down_to_right_bank; case TRACK_ELEM_LEFT_BANK: - return spiral_rc_track_left_bank; case TRACK_ELEM_RIGHT_BANK: - return spiral_rc_track_right_bank; case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_UP: - return spiral_rc_track_left_quarter_turn_5_25_deg_up; case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_UP: - return spiral_rc_track_right_quarter_turn_5_25_deg_up; case TRACK_ELEM_LEFT_QUARTER_TURN_5_TILES_25_DEG_DOWN: - return spiral_rc_track_left_quarter_turn_5_25_deg_down; case TRACK_ELEM_RIGHT_QUARTER_TURN_5_TILES_25_DEG_DOWN: - return spiral_rc_track_right_quarter_turn_5_25_deg_down; case TRACK_ELEM_S_BEND_LEFT: - return spiral_rc_track_s_bend_left; case TRACK_ELEM_S_BEND_RIGHT: - return spiral_rc_track_s_bend_right; case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES: - return spiral_rc_track_left_quarter_turn_3; case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES: - return spiral_rc_track_right_quarter_turn_3; case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_BANK: - return spiral_rc_track_left_quarter_turn_3_bank; case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_BANK: - return spiral_rc_track_right_quarter_turn_3_bank; case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_UP: - return spiral_rc_track_left_quarter_turn_3_25_deg_up; case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_UP: - return spiral_rc_track_right_quarter_turn_3_25_deg_up; case TRACK_ELEM_LEFT_QUARTER_TURN_3_TILES_25_DEG_DOWN: - return spiral_rc_track_left_quarter_turn_3_25_deg_down; case TRACK_ELEM_RIGHT_QUARTER_TURN_3_TILES_25_DEG_DOWN: - return spiral_rc_track_right_quarter_turn_3_25_deg_down; case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_SMALL: - return spiral_rc_track_left_half_banked_helix_up_small; case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_SMALL: - return spiral_rc_track_right_half_banked_helix_up_small; case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_SMALL: - return spiral_rc_track_left_half_banked_helix_down_small; case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_SMALL: - return spiral_rc_track_right_half_banked_helix_down_small; case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_UP_LARGE: - return spiral_rc_track_left_half_banked_helix_up_large; case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_UP_LARGE: - return spiral_rc_track_right_half_banked_helix_up_large; case TRACK_ELEM_LEFT_HALF_BANKED_HELIX_DOWN_LARGE: - return spiral_rc_track_left_half_banked_helix_down_large; case TRACK_ELEM_RIGHT_HALF_BANKED_HELIX_DOWN_LARGE: - return spiral_rc_track_right_half_banked_helix_down_large; case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_UP: - return spiral_rc_track_left_quarter_turn_1_60_deg_up; case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_UP: - return spiral_rc_track_right_quarter_turn_1_60_deg_up; case TRACK_ELEM_LEFT_QUARTER_TURN_1_TILE_60_DEG_DOWN: - return spiral_rc_track_left_quarter_turn_1_60_deg_down; case TRACK_ELEM_RIGHT_QUARTER_TURN_1_TILE_60_DEG_DOWN: - return spiral_rc_track_right_quarter_turn_1_60_deg_down; case TRACK_ELEM_BRAKES: - return spiral_rc_track_brakes; case TRACK_ELEM_25_DEG_UP_LEFT_BANKED: - return spiral_rc_track_25_deg_up_left_banked; case TRACK_ELEM_25_DEG_UP_RIGHT_BANKED: - return spiral_rc_track_25_deg_up_right_banked; case TRACK_ELEM_ON_RIDE_PHOTO: - return spiral_rc_track_on_ride_photo; case TRACK_ELEM_25_DEG_DOWN_LEFT_BANKED: - return spiral_rc_track_25_deg_down_left_banked; case TRACK_ELEM_25_DEG_DOWN_RIGHT_BANKED: - return spiral_rc_track_25_deg_down_right_banked; case TRACK_ELEM_LEFT_EIGHTH_TO_DIAG: - return spiral_rc_track_left_eighth_to_diag; case TRACK_ELEM_RIGHT_EIGHTH_TO_DIAG: - return spiral_rc_track_right_eighth_to_diag; case TRACK_ELEM_LEFT_EIGHTH_TO_ORTHOGONAL: - return spiral_rc_track_left_eighth_to_orthogonal; case TRACK_ELEM_RIGHT_EIGHTH_TO_ORTHOGONAL: - return spiral_rc_track_right_eighth_to_orthogonal; case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_DIAG: - return spiral_rc_track_left_eighth_bank_to_diag; case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_DIAG: - return spiral_rc_track_right_eighth_bank_to_diag; case TRACK_ELEM_LEFT_EIGHTH_BANK_TO_ORTHOGONAL: - return spiral_rc_track_left_eighth_bank_to_orthogonal; case TRACK_ELEM_RIGHT_EIGHTH_BANK_TO_ORTHOGONAL: - return spiral_rc_track_right_eighth_bank_to_orthogonal; case TRACK_ELEM_DIAG_FLAT: - return spiral_rc_track_diag_flat; case TRACK_ELEM_DIAG_25_DEG_UP: - return spiral_rc_track_diag_25_deg_up; case TRACK_ELEM_DIAG_60_DEG_UP: - return spiral_rc_track_diag_60_deg_up; case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_UP: - return spiral_rc_track_diag_flat_to_25_deg_up; case TRACK_ELEM_DIAG_25_DEG_UP_TO_60_DEG_UP: - return spiral_rc_track_diag_25_deg_up_to_60_deg_up; case TRACK_ELEM_DIAG_60_DEG_UP_TO_25_DEG_UP: - return spiral_rc_track_diag_60_deg_up_to_25_deg_up; case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT: - return spiral_rc_track_diag_25_deg_up_to_flat; case TRACK_ELEM_DIAG_25_DEG_DOWN: - return spiral_rc_track_diag_25_deg_down; case TRACK_ELEM_DIAG_60_DEG_DOWN: - return spiral_rc_track_diag_60_deg_down; case TRACK_ELEM_DIAG_FLAT_TO_25_DEG_DOWN: - return spiral_rc_track_diag_flat_to_25_deg_down; case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_60_DEG_DOWN: - return spiral_rc_track_diag_25_deg_down_to_60_deg_down; case TRACK_ELEM_DIAG_60_DEG_DOWN_TO_25_DEG_DOWN: - return spiral_rc_track_diag_60_deg_down_to_25_deg_down; case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_FLAT: - return spiral_rc_track_diag_25_deg_down_to_flat; case TRACK_ELEM_DIAG_FLAT_TO_LEFT_BANK: - return spiral_rc_track_diag_flat_to_left_bank; case TRACK_ELEM_DIAG_FLAT_TO_RIGHT_BANK: - return spiral_rc_track_diag_flat_to_right_bank; case TRACK_ELEM_DIAG_LEFT_BANK_TO_FLAT: - return spiral_rc_track_diag_left_bank_to_flat; case TRACK_ELEM_DIAG_RIGHT_BANK_TO_FLAT: - return spiral_rc_track_diag_right_bank_to_flat; case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_UP: - return spiral_rc_track_diag_left_bank_to_25_deg_up; case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_UP: - return spiral_rc_track_diag_right_bank_to_25_deg_up; case TRACK_ELEM_DIAG_25_DEG_UP_TO_LEFT_BANK: - return spiral_rc_track_diag_25_deg_up_to_left_bank; case TRACK_ELEM_DIAG_25_DEG_UP_TO_RIGHT_BANK: - return spiral_rc_track_diag_25_deg_up_to_right_bank; case TRACK_ELEM_DIAG_LEFT_BANK_TO_25_DEG_DOWN: - return spiral_rc_track_diag_left_bank_to_25_deg_down; case TRACK_ELEM_DIAG_RIGHT_BANK_TO_25_DEG_DOWN: - return spiral_rc_track_diag_right_bank_to_25_deg_down; case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_LEFT_BANK: - return spiral_rc_track_diag_25_deg_down_to_left_bank; case TRACK_ELEM_DIAG_25_DEG_DOWN_TO_RIGHT_BANK: - return spiral_rc_track_diag_25_deg_down_to_right_bank; case TRACK_ELEM_DIAG_LEFT_BANK: - return spiral_rc_track_diag_left_bank; case TRACK_ELEM_DIAG_RIGHT_BANK: - return spiral_rc_track_diag_right_bank; + case TRACK_ELEM_BLOCK_BRAKES: + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: + case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: + case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANKED_25_DEG_UP: + case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANKED_25_DEG_UP: + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_25_DEG_UP: + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_25_DEG_UP: + case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANKED_25_DEG_DOWN: + case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANKED_25_DEG_DOWN: + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_UP: + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_LEFT_BANKED_FLAT: + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_RIGHT_BANKED_FLAT: + case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_LEFT_BANKED_FLAT: + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_RIGHT_BANKED_FLAT: + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_UP: + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_UP: + case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_FLAT: + case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_FLAT: + case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: + case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: + case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_FLAT: + case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_FLAT: + return get_track_paint_function_mini_rc(trackType, direction); + case TRACK_ELEM_LEFT_CURVED_LIFT_HILL: return spiral_rc_track_left_curved_lift_hill; case TRACK_ELEM_RIGHT_CURVED_LIFT_HILL: return spiral_rc_track_right_curved_lift_hill; - case TRACK_ELEM_BLOCK_BRAKES: - return spiral_rc_track_block_brakes; - case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: - return spiral_rc_track_left_banked_quarter_turn_3_25_deg_up; - case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_UP: - return spiral_rc_track_right_banked_quarter_turn_3_25_deg_up; - case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: - return spiral_rc_track_left_banked_quarter_turn_3_25_deg_down; - case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_3_TILE_25_DEG_DOWN: - return spiral_rc_track_right_banked_quarter_turn_3_25_deg_down; - case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: - return spiral_rc_track_left_banked_quarter_turn_5_25_deg_up; - case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_UP: - return spiral_rc_track_right_banked_quarter_turn_5_25_deg_up; - case TRACK_ELEM_LEFT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: - return spiral_rc_track_left_banked_quarter_turn_5_25_deg_down; - case TRACK_ELEM_RIGHT_BANKED_QUARTER_TURN_5_TILE_25_DEG_DOWN: - return spiral_rc_track_right_banked_quarter_turn_5_25_deg_down; - case TRACK_ELEM_25_DEG_UP_TO_LEFT_BANKED_25_DEG_UP: - return spiral_rc_track_25_deg_up_to_left_banked_25_deg_up; - case TRACK_ELEM_25_DEG_UP_TO_RIGHT_BANKED_25_DEG_UP: - return spiral_rc_track_25_deg_up_to_right_banked_25_deg_up; - case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_25_DEG_UP: - return spiral_rc_track_left_banked_25_deg_up_to_25_deg_up; - case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_25_DEG_UP: - return spiral_rc_track_right_banked_25_deg_up_to_25_deg_up; - case TRACK_ELEM_25_DEG_DOWN_TO_LEFT_BANKED_25_DEG_DOWN: - return spiral_rc_track_25_deg_down_to_left_banked_25_deg_down; - case TRACK_ELEM_25_DEG_DOWN_TO_RIGHT_BANKED_25_DEG_DOWN: - return spiral_rc_track_25_deg_down_to_right_banked_25_deg_down; - case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: - return spiral_rc_track_left_banked_25_deg_down_to_25_deg_down; - case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_25_DEG_DOWN: - return spiral_rc_track_right_banked_25_deg_down_to_25_deg_down; - case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_UP: - return spiral_rc_track_left_banked_flat_to_left_banked_25_deg_up; - case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_UP: - return spiral_rc_track_right_banked_flat_to_right_banked_25_deg_up; - case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_LEFT_BANKED_FLAT: - return spiral_rc_track_left_banked_25_deg_up_to_left_banked_flat; - case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_RIGHT_BANKED_FLAT: - return spiral_rc_track_right_banked_25_deg_up_to_right_banked_flat; - case TRACK_ELEM_LEFT_BANKED_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: - return spiral_rc_track_left_banked_flat_to_left_banked_25_deg_down; - case TRACK_ELEM_RIGHT_BANKED_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: - return spiral_rc_track_right_banked_flat_to_right_banked_25_deg_down; - case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_LEFT_BANKED_FLAT: - return spiral_rc_track_left_banked_25_deg_down_to_left_banked_flat; - case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_RIGHT_BANKED_FLAT: - return spiral_rc_track_right_banked_25_deg_down_to_right_banked_flat; - case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_UP: - return spiral_rc_track_flat_to_left_banked_25_deg_up; - case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_UP: - return spiral_rc_track_flat_to_right_banked_25_deg_up; - case TRACK_ELEM_LEFT_BANKED_25_DEG_UP_TO_FLAT: - return spiral_rc_track_left_banked_25_deg_up_to_flat; - case TRACK_ELEM_RIGHT_BANKED_25_DEG_UP_TO_FLAT: - return spiral_rc_track_right_banked_25_deg_up_to_flat; - case TRACK_ELEM_FLAT_TO_LEFT_BANKED_25_DEG_DOWN: - return spiral_rc_track_flat_to_left_banked_25_deg_down; - case TRACK_ELEM_FLAT_TO_RIGHT_BANKED_25_DEG_DOWN: - return spiral_rc_track_flat_to_right_banked_25_deg_down; - case TRACK_ELEM_LEFT_BANKED_25_DEG_DOWN_TO_FLAT: - return spiral_rc_track_left_banked_25_deg_down_to_flat; - case TRACK_ELEM_RIGHT_BANKED_25_DEG_DOWN_TO_FLAT: - return spiral_rc_track_right_banked_25_deg_down_to_flat; } return NULL; } From 425cf76b5d39ea0119f8c0d1eddb239439f32463 Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 23:46:14 +0100 Subject: [PATCH 49/55] Removed unused functions in lim launched roller coaster --- .../coaster/lim_launched_roller_coaster.c | 5730 ----------------- 1 file changed, 5730 deletions(-) diff --git a/src/ride/coaster/lim_launched_roller_coaster.c b/src/ride/coaster/lim_launched_roller_coaster.c index 43fe39e56f..a6d4e1d87a 100644 --- a/src/ride/coaster/lim_launched_roller_coaster.c +++ b/src/ride/coaster/lim_launched_roller_coaster.c @@ -26,46 +26,6 @@ #include "../track_data.h" #include "../track_paint.h" -static void lim_launched_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15006, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15007, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15008, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15009, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - } - } else { - switch (direction) { - case 0: - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15004, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15005, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - } - } - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); -} - static void lim_launched_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { static const uint32 imageIds[4][3] = { @@ -88,1281 +48,6 @@ static void lim_launched_rc_track_station(uint8 rideIndex, uint8 trackSequence, paint_util_set_general_support_height(height + 32, 0x20); } -static void lim_launched_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15060, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15061, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15062, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15063, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15032, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15033, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15034, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15035, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - } - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); -} - -static void lim_launched_rc_track_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15076, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15077, 0, 0, 32, 1, 98, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15078, 0, 0, 32, 1, 98, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15079, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15048, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15049, 0, 0, 32, 1, 98, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15050, 0, 0, 32, 1, 98, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15051, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 32, height, gTrackColours[SCHEME_SUPPORTS]); - } - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } else { - paint_util_push_tunnel_rotated(direction, height + 56, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); -} - -static void lim_launched_rc_track_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15052, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15053, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15054, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15055, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15024, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15025, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15026, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15027, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); - } - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } else { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); -} - -static void lim_launched_rc_track_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15064, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15065, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15068, 0, 0, 32, 1, 66, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15066, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15069, 0, 0, 32, 1, 66, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15067, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15036, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15037, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15040, 0, 0, 32, 1, 66, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15038, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15041, 0, 0, 32, 1, 66, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15039, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 12, height, gTrackColours[SCHEME_SUPPORTS]); - } - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } else { - paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); -} - -static void lim_launched_rc_track_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15070, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15071, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15074, 0, 0, 32, 1, 66, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15072, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15075, 0, 0, 32, 1, 66, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15073, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15042, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15043, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15046, 0, 0, 32, 1, 66, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15044, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15047, 0, 0, 32, 1, 66, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15045, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 20, height, gTrackColours[SCHEME_SUPPORTS]); - } - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } else { - paint_util_push_tunnel_rotated(direction, height + 24, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); -} - -static void lim_launched_rc_track_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15056, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15057, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15058, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15059, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15028, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15029, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15030, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15031, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 40, 0x20); -} - -static void lim_launched_rc_track_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_60_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_25_deg_up_to_60_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_flat_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15183, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15188, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15193, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15178, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15182, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15187, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15192, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15177, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15181, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15186, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15191, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15176, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 5: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15180, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15185, 0, 0, 16, 32, 3, height, 0, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15190, 0, 0, 16, 32, 3, height, 0, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15175, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15179, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15184, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15189, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15174, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - } - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 2: - paint_util_push_tunnel_right(height, TUNNEL_0); - break; - case 3: - paint_util_push_tunnel_left(height, TUNNEL_0); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lim_launched_rc_track_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void lim_launched_rc_track_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15080, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15092, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15081, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15093, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15082, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15083, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - } - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); -} - -static void lim_launched_rc_track_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15084, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15085, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15086, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15094, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15087, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15095, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - } - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); -} - -static void lim_launched_rc_track_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15086, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15094, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15087, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15095, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15084, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15085, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - } - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); -} - -static void lim_launched_rc_track_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15082, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15083, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15080, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15092, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15081, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15093, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - } - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); -} - -static void lim_launched_rc_track_banked_left_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15203, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15214, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15208, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15213, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15198, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15202, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15207, 0, 0, 32, 16, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15212, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15197, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15201, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15206, 0, 0, 16, 16, 1, height, 16, 16, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15211, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15196, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 5: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15200, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15205, 0, 0, 16, 32, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15210, 0, 0, 16, 32, 3, height, 0, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15195, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15199, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15204, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15209, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15215, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15194, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - } - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 2: - paint_util_push_tunnel_right(height, TUNNEL_0); - break; - case 3: - paint_util_push_tunnel_left(height, TUNNEL_0); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_banked_right_quarter_turn_5(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lim_launched_rc_track_banked_left_quarter_turn_5(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void lim_launched_rc_track_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15096, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15112, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15097, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15113, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15098, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15099, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } else { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); -} - -static void lim_launched_rc_track_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15100, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15101, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15102, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15114, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15103, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15115, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } else { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); -} - -static void lim_launched_rc_track_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15104, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15116, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15105, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15117, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15106, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15107, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 40, 0x20); -} - -static void lim_launched_rc_track_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15108, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15109, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15110, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15118, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15111, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15119, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 40, 0x20); -} - -static void lim_launched_rc_track_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_25_deg_up_to_right_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_25_deg_up_to_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_right_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_left_bank_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15088, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15089, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15090, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15091, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - } - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); -} - -static void lim_launched_rc_track_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_left_bank(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_left_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15296, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15301, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15306, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15311, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15297, 0, 0, 32, 16, 3, height); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15302, 0, 0, 32, 16, 3, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15307, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15312, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15298, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15303, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15308, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15313, 0, 0, 16, 16, 3, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 64, 0x20); - break; - case 4: - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 5: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15299, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15304, 0, 0, 16, 32, 3, height); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15309, 0, 0, 16, 32, 3, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15314, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15300, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15305, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15310, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15315, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - } - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 2: - paint_util_push_tunnel_right(height + 8, TUNNEL_2); - break; - case 3: - paint_util_push_tunnel_left(height + 8, TUNNEL_2); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void lim_launched_rc_track_right_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15276, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15281, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15286, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15291, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15277, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15282, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15287, 0, 0, 32, 16, 3, height); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15292, 0, 0, 32, 16, 3, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15278, 0, 0, 16, 16, 3, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15283, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15288, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15293, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 64, 0x20); - break; - case 4: - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 5: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15279, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15284, 0, 0, 16, 32, 3, height); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15289, 0, 0, 16, 32, 3, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15294, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15280, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15285, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15290, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15295, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - } - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 0: - paint_util_push_tunnel_right(height + 8, TUNNEL_2); - break; - case 1: - paint_util_push_tunnel_left(height + 8, TUNNEL_2); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void lim_launched_rc_track_left_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lim_launched_rc_track_right_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); -} - -static void lim_launched_rc_track_right_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lim_launched_rc_track_left_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void lim_launched_rc_track_s_bend_left(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15260, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15264, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15263, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15267, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15261, 0, 0, 32, 26, 3, height); - metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15265, 0, 0, 32, 26, 3, height); - metal_a_supports_paint_setup(0, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15262, 0, 0, 32, 26, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15266, 0, 0, 32, 26, 3, height, 0, 6, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15262, 0, 0, 32, 26, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15266, 0, 0, 32, 26, 3, height, 0, 6, height); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15261, 0, 0, 32, 26, 3, height); - metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15265, 0, 0, 32, 26, 3, height); - metal_a_supports_paint_setup(0, 6, 1, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15263, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15267, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15260, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15264, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 1: - paint_util_push_tunnel_right(height, TUNNEL_0); - break; - case 2: - paint_util_push_tunnel_left(height, TUNNEL_0); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_s_bend_right(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15268, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15272, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15271, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15275, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15269, 0, 0, 32, 26, 3, height, 0, 6, height); - metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15273, 0, 0, 32, 26, 3, height, 0, 6, height); - metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15270, 0, 0, 32, 26, 3, height); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15274, 0, 0, 32, 26, 3, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15270, 0, 0, 32, 26, 3, height); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15274, 0, 0, 32, 26, 3, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15269, 0, 0, 32, 26, 3, height, 0, 6, height); - metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15273, 0, 0, 32, 26, 3, height, 0, 6, height); - metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15271, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15275, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15268, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15272, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 1: - paint_util_push_tunnel_right(height, TUNNEL_0); - break; - case 2: - paint_util_push_tunnel_left(height, TUNNEL_0); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - static void lim_launched_rc_track_left_vertical_loop(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { switch (trackSequence) { @@ -1707,309 +392,6 @@ static void lim_launched_rc_track_right_vertical_loop(uint8 rideIndex, uint8 tra } } -static void lim_launched_rc_track_left_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15125, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15128, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15131, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15122, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15124, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15127, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15130, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15121, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15123, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15126, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15129, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15120, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - } - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 2: - paint_util_push_tunnel_right(height, TUNNEL_0); - break; - case 3: - paint_util_push_tunnel_left(height, TUNNEL_0); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_right_quarter_turn_3(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lim_launched_rc_track_left_quarter_turn_3(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void lim_launched_rc_track_left_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15137, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15144, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15140, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15143, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15134, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15136, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15139, 0, 0, 16, 16, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15142, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15133, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15135, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15138, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15141, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15145, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15132, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - } - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 2: - paint_util_push_tunnel_right(height, TUNNEL_0); - break; - case 3: - paint_util_push_tunnel_left(height, TUNNEL_0); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_right_quarter_turn_3_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lim_launched_rc_track_left_quarter_turn_3_bank(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void lim_launched_rc_track_left_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15327, 0, 6, 32, 20, 3, height); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15329, 0, 6, 32, 20, 3, height); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15331, 0, 6, 32, 20, 3, height); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15325, 0, 6, 32, 20, 3, height); - break; - } - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15326, 6, 0, 20, 32, 3, height); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15328, 6, 0, 20, 32, 3, height); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15330, 6, 0, 20, 32, 3, height); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15324, 6, 0, 20, 32, 3, height); - break; - } - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 2: - paint_util_push_tunnel_right(height + 8, TUNNEL_2); - break; - case 3: - paint_util_push_tunnel_left(height + 8, TUNNEL_2); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void lim_launched_rc_track_right_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15316, 0, 6, 32, 20, 3, height); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15318, 0, 6, 32, 20, 3, height); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15320, 0, 6, 32, 20, 3, height); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15322, 0, 6, 32, 20, 3, height); - break; - } - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15317, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15319, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15321, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15323, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 0: - paint_util_push_tunnel_right(height + 8, TUNNEL_2); - break; - case 1: - paint_util_push_tunnel_left(height + 8, TUNNEL_2); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void lim_launched_rc_track_left_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lim_launched_rc_track_right_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); -} - -static void lim_launched_rc_track_right_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lim_launched_rc_track_left_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - static void lim_launched_rc_track_left_twist_down_to_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { switch (trackSequence) { @@ -2502,884 +884,6 @@ static void lim_launched_rc_track_right_corkscrew_down(uint8 rideIndex, uint8 tr lim_launched_rc_track_left_corkscrew_up(rideIndex, 2 - trackSequence, (direction - 1) & 3, height, mapElement); } -static void lim_launched_rc_track_left_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15165, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15172, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15168, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15171, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15162, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15164, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15167, 0, 0, 16, 16, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15170, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15161, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15163, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15166, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15169, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15173, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15160, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - } - metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 2: - paint_util_push_tunnel_right(height + 8, TUNNEL_0); - break; - case 3: - paint_util_push_tunnel_left(height + 8, TUNNEL_0); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15162, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15165, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15172, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15168, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15171, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - } - metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 0: - paint_util_push_tunnel_right(height, TUNNEL_0); - break; - case 1: - paint_util_push_tunnel_left(height, TUNNEL_0); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 5: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15161, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15164, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15167, 0, 0, 16, 16, 1, height, 0, 0, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15170, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 7: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15160, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15163, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15166, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15169, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15173, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - } - metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_right_half_banked_helix_up_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15146, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15149, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15152, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15155, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15159, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - } - metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15147, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15150, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15153, 0, 0, 16, 16, 1, height, 0, 0, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15156, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15148, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15151, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15158, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15154, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15157, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - } - metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 0: - paint_util_push_tunnel_right(height + 8, TUNNEL_0); - break; - case 1: - paint_util_push_tunnel_left(height + 8, TUNNEL_0); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15149, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15152, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15155, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15159, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15146, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - } - metal_a_supports_paint_setup(0, 4, 2, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 2: - paint_util_push_tunnel_right(height, TUNNEL_0); - break; - case 3: - paint_util_push_tunnel_left(height, TUNNEL_0); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 5: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15150, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15153, 0, 0, 16, 16, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15156, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15147, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 7: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15151, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15158, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15154, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15157, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15148, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_left_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (trackSequence >= 4) { - trackSequence -= 4; - direction = (direction - 1) & 3; - } - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lim_launched_rc_track_right_half_banked_helix_up_small(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); -} - -static void lim_launched_rc_track_right_half_banked_helix_down_small(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (trackSequence >= 4) { - trackSequence -= 4; - direction = (direction + 1) & 3; - } - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lim_launched_rc_track_left_half_banked_helix_up_small(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void lim_launched_rc_track_left_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15247, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15258, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15252, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15257, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15242, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15246, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15251, 0, 0, 32, 16, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15256, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15241, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15245, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15250, 0, 0, 16, 16, 1, height, 16, 16, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15255, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15240, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 5: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15244, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15249, 0, 0, 16, 32, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15254, 0, 0, 16, 32, 3, height, 0, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15239, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15243, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15248, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15253, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15259, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15238, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - } - metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 2: - paint_util_push_tunnel_right(height + 8, TUNNEL_0); - break; - case 3: - paint_util_push_tunnel_left(height + 8, TUNNEL_0); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 7: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15242, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15247, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15258, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15252, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15257, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - } - metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 0: - paint_util_push_tunnel_right(height, TUNNEL_0); - break; - case 1: - paint_util_push_tunnel_left(height, TUNNEL_0); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 8: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 9: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15241, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15246, 0, 0, 16, 32, 3, height, 0, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15251, 0, 0, 16, 32, 1, height, 0, 0, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15256, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 10: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15240, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15245, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15250, 0, 0, 16, 16, 1, height, 16, 16, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15255, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 11: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 12: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15239, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15244, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15249, 0, 0, 32, 16, 1, height, 0, 0, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15254, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 13: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15238, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15243, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15248, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15253, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15259, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - } - metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_right_half_banked_helix_up_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15216, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15221, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15226, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15231, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15237, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - } - metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15217, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15222, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15227, 0, 0, 32, 16, 1, height, 0, 0, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15232, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15218, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15223, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15228, 0, 0, 16, 16, 1, height, 16, 16, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15233, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 5: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15219, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15224, 0, 0, 16, 32, 3, height, 0, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15229, 0, 0, 16, 32, 1, height, 0, 0, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15234, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15220, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15225, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15236, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15230, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15235, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - } - metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 0: - paint_util_push_tunnel_right(height + 8, TUNNEL_0); - break; - case 1: - paint_util_push_tunnel_left(height + 8, TUNNEL_0); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 7: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15221, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15226, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15231, 0, 0, 20, 32, 3, height, 6, 0, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15237, 0, 0, 1, 32, 26, height, 27, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15216, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - } - metal_a_supports_paint_setup(0, 4, 1, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 2: - paint_util_push_tunnel_right(height, TUNNEL_0); - break; - case 3: - paint_util_push_tunnel_left(height, TUNNEL_0); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 8: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 9: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15222, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15227, 0, 0, 16, 32, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15232, 0, 0, 16, 32, 3, height, 0, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15217, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 10: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15223, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15228, 0, 0, 16, 16, 1, height, 16, 16, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15233, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15218, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 11: - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 12: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15224, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15229, 0, 0, 32, 16, 1, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15234, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15219, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 13: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15225, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15236, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15230, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15235, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15220, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 7, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_left_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (trackSequence >= 7) { - trackSequence -= 7; - direction = (direction - 1) & 3; - } - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lim_launched_rc_track_right_half_banked_helix_up_large(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); -} - -static void lim_launched_rc_track_right_half_banked_helix_down_large(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - if (trackSequence >= 7) { - trackSequence -= 7; - direction = (direction + 1) & 3; - } - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lim_launched_rc_track_left_half_banked_helix_up_large(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void lim_launched_rc_track_left_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15341, 0, 0, 28, 28, 3, height, 2, 2, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15345, 0, 0, 28, 28, 1, height, 2, 2, height + 99); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15342, 0, 0, 28, 28, 3, height, 2, 2, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15346, 0, 0, 28, 28, 1, height, 2, 2, height + 99); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15343, 0, 0, 28, 28, 3, height, 2, 2, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15347, 0, 0, 28, 28, 1, height, 2, 2, height + 99); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15340, 0, 0, 28, 28, 3, height, 2, 2, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15344, 0, 0, 28, 28, 1, height, 2, 2, height + 99); - break; - } - switch (direction) { - case 0: - paint_util_push_tunnel_left(height - 8, TUNNEL_2); - break; - case 2: - paint_util_push_tunnel_right(height + 56, TUNNEL_1); - break; - case 3: - paint_util_push_tunnel_right(height - 8, TUNNEL_1); - paint_util_push_tunnel_left(height + 56, TUNNEL_1); - break; - } - paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); -} - -static void lim_launched_rc_track_right_quarter_turn_1_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15332, 0, 0, 28, 28, 3, height, 2, 2, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15336, 0, 0, 28, 28, 1, height, 2, 2, height + 99); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15333, 0, 0, 28, 28, 3, height, 2, 2, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15337, 0, 0, 28, 28, 1, height, 2, 2, height + 99); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15334, 0, 0, 28, 28, 3, height, 2, 2, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15338, 0, 0, 2, 28, 59, height, 28, 2, height + 2); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15335, 0, 0, 28, 28, 3, height, 2, 2, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15339, 0, 0, 28, 28, 1, height, 2, 2, height + 99); - break; - } - switch (direction) { - case 0: - paint_util_push_tunnel_right(height + 56, TUNNEL_1); - paint_util_push_tunnel_left(height - 8, TUNNEL_1); - break; - case 1: - paint_util_push_tunnel_left(height + 56, TUNNEL_2); - break; - case 3: - paint_util_push_tunnel_right(height - 8, TUNNEL_1); - break; - } - paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); -} - -static void lim_launched_rc_track_left_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_right_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); -} - -static void lim_launched_rc_track_right_quarter_turn_1_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_left_quarter_turn_1_60_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - static void lim_launched_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { switch (direction) { @@ -3400,111 +904,6 @@ static void lim_launched_rc_track_brakes(uint8 rideIndex, uint8 trackSequence, u paint_util_set_general_support_height(height + 32, 0x20); } -static void lim_launched_rc_track_25_deg_up_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15594, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15595, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15596, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15597, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); -} - -static void lim_launched_rc_track_25_deg_up_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15598, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15599, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15600, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15601, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); -} - -static void lim_launched_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_MISC] | 22432, 0, 0, 32, 32, 1, height); - metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15004, 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, gTrackColours[SCHEME_MISC] | 22432, 0, 0, 32, 32, 1, height); - metal_a_supports_paint_setup(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15005, 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, gTrackColours[SCHEME_MISC] | 22432, 0, 0, 32, 32, 1, height); - metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15004, 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, gTrackColours[SCHEME_MISC] | 22432, 0, 0, 32, 32, 1, height); - metal_a_supports_paint_setup(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); - metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15005, 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); - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); -} - -static void lim_launched_rc_track_25_deg_down_left_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_25_deg_up_right_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_25_deg_down_right_banked(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_25_deg_up_left_banked(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - static void lim_launched_rc_track_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { switch (trackSequence) { @@ -3629,2352 +1028,6 @@ static void lim_launched_rc_track_60_deg_down_to_90_deg_down(uint8 rideIndex, ui } } -static void lim_launched_rc_track_left_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15526, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15530, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15534, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15538, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15527, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15531, 0, 0, 34, 16, 3, height, 0, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15535, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15539, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15528, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15532, 0, 0, 16, 16, 3, height, 16, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15536, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15540, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15529, 0, 0, 16, 16, 3, height, 16, 16, height); - metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15533, 0, 0, 16, 18, 3, height, 0, 16, height); - metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15537, 0, 0, 16, 16, 3, height, 0, 0, height); - metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15541, 0, 0, 16, 16, 3, height, 16, 0, height); - metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_right_eighth_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15510, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15514, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15518, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15522, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15511, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15515, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15519, 0, 0, 34, 16, 3, height, 0, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15523, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15512, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15516, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15520, 0, 0, 28, 28, 3, height, 4, 4, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15524, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15513, 0, 0, 16, 16, 3, height, 16, 0, height); - metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15517, 0, 0, 16, 16, 3, height, 0, 0, height); - metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15521, 0, 0, 16, 18, 3, height, 0, 16, height); - metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15525, 0, 0, 16, 16, 3, height, 16, 16, height); - metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_left_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - lim_launched_rc_track_right_eighth_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_right_eighth_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - lim_launched_rc_track_left_eighth_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); -} - -static void lim_launched_rc_track_left_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15558, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15562, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15566, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15570, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15559, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15563, 0, 0, 34, 16, 0, height, 0, 0, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15567, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15571, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15560, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15564, 0, 0, 16, 16, 0, height, 16, 16, height + 27); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15568, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15572, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15561, 0, 0, 16, 16, 3, height, 16, 16, height); - metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15565, 0, 0, 16, 18, 0, height, 0, 16, height + 27); - metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15569, 0, 0, 16, 16, 3, height, 0, 0, height); - metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15573, 0, 0, 16, 16, 3, height, 16, 0, height); - metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_right_eighth_bank_to_diag(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15542, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15546, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15550, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15554, 0, 0, 32, 1, 26, height, 0, 27, height); - break; - } - metal_a_supports_paint_setup(0, 4, 0, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15543, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15547, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15551, 0, 0, 34, 16, 0, height, 0, 0, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15555, 0, 0, 32, 16, 3, height, 0, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15544, 0, 0, 16, 16, 3, height, 0, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15548, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15552, 0, 0, 28, 28, 0, height, 4, 4, height + 27); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15556, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 4: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15545, 0, 0, 16, 16, 3, height, 16, 0, height); - metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15549, 0, 0, 16, 16, 3, height, 0, 0, height); - metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15553, 0, 0, 16, 18, 0, height, 0, 16, height + 27); - metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15557, 0, 0, 16, 16, 3, height, 16, 16, height); - metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_left_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - lim_launched_rc_track_right_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_right_eighth_bank_to_orthogonal(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; - lim_launched_rc_track_left_eighth_bank_to_diag(rideIndex, trackSequence, (direction + 3) & 3, height, mapElement); -} - -static void lim_launched_rc_track_diag_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15451, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15423, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15448, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15420, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15450, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15422, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15449, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15421, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15463, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15435, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15460, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15432, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15462, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15434, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15461, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15433, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15475, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15447, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15472, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15444, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15474, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15446, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 36, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15473, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 36, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 36, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15445, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 36, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 36, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 36, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_flat_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15455, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15427, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15452, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15424, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15454, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15426, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15453, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15425, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_25_deg_up_to_60_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15467, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15439, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15464, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15436, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15466, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15438, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15465, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 16, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15437, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 16, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 16, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 16, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_60_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15471, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15443, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15468, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15440, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15470, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15442, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15469, -16, -16, 16, 16, 3, height, 0, 0, height); - metal_b_supports_paint_setup(0, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 21, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15441, -16, -16, 16, 16, 3, height, 0, 0, height); - metal_b_supports_paint_setup(0, 0, 21, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 21, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 21, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15459, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15431, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15456, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15428, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15458, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15430, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15457, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15429, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15461, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15433, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15462, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15434, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15460, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15432, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15463, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15435, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15473, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15445, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15474, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15446, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15472, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15444, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 28, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15475, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 28, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 28, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15447, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 28, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 28, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 28, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 104, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_flat_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15457, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15429, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15458, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15430, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15456, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15428, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15459, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15431, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_25_deg_down_to_60_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15469, -16, -16, 16, 16, 3, height, 0, 0, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15441, -16, -16, 16, 16, 3, height, 0, 0, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15470, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15442, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15468, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15440, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15471, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 17, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15443, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 17, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 17, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 17, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_60_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15465, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15437, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15466, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15438, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15464, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15436, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15467, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15439, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15453, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15425, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15454, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15426, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 2: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15452, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } else { - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15424, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 3: - if (track_element_is_lift_hill(mapElement)) { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15455, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } else { - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15427, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_flat_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15503, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15500, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15504, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15502, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15501, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_flat_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15508, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15505, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15507, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15509, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15506, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_left_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15506, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15507, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15509, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15505, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15508, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_right_bank_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15501, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15502, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15500, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15504, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15503, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_left_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15493, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15490, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15494, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15492, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15491, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_right_bank_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15498, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15495, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15497, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15499, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15496, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_25_deg_up_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15483, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15480, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15484, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15482, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15481, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_25_deg_up_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15488, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15485, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15487, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15489, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15486, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_left_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15486, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15487, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15489, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15485, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15488, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_right_bank_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15481, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15482, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15480, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15484, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15483, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 4, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_25_deg_down_to_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15496, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15497, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15499, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15495, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15498, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_25_deg_down_to_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15491, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15492, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15490, -16, -16, 32, 32, 3, height, -16, -16, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15494, -16, -16, 32, 32, 0, height, -16, -16, height + 35); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_b_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15493, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_b_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_b_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_b_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_left_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15479, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15476, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15478, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15477, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - -static void lim_launched_rc_track_diag_right_bank(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15477, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 1: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15478, -16, -16, 32, 32, 3, height, -16, -16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 2: - switch (direction) { - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15476, -16, -16, 32, 32, 0, height, -16, -16, height + 27); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - case 3: - switch (direction) { - case 0: - metal_a_supports_paint_setup(0, 1, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15479, -16, -16, 32, 32, 3, height, -16, -16, height); - metal_a_supports_paint_setup(0, 0, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - metal_a_supports_paint_setup(0, 2, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - metal_a_supports_paint_setup(0, 3, 0, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 32, 0x20); - break; - } -} - static void lim_launched_rc_track_90_deg_to_inverted_flat_quarter_loop_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { switch (trackSequence) { @@ -6063,789 +1116,6 @@ static void lim_launched_rc_track_block_brakes(uint8 rideIndex, uint8 trackSeque paint_util_set_general_support_height(height + 32, 0x20); } -static void lim_launched_rc_track_left_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15689, 0, 6, 32, 20, 3, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15691, 0, 6, 32, 1, 34, height, 0, 27, height); - break; - case 2: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15693, 0, 6, 32, 20, 3, height); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15687, 0, 6, 32, 20, 3, height); - break; - } - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15688, 6, 0, 20, 32, 3, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15690, 6, 0, 1, 32, 34, height, 27, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15692, 6, 0, 1, 32, 34, height, 27, 0, height); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15686, 6, 0, 20, 32, 3, height); - break; - } - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 2: - paint_util_push_tunnel_right(height + 8, TUNNEL_2); - break; - case 3: - paint_util_push_tunnel_left(height + 8, TUNNEL_2); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void lim_launched_rc_track_right_banked_quarter_turn_3_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15678, 0, 6, 32, 20, 3, height); - break; - case 1: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15680, 0, 6, 32, 20, 3, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15682, 0, 6, 32, 1, 34, height, 0, 27, height); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15684, 0, 6, 32, 20, 3, height); - break; - } - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 2: - paint_util_set_general_support_height(height + 56, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15679, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15681, 6, 0, 1, 32, 34, height, 27, 0, height); - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15683, 6, 0, 1, 32, 34, height, 27, 0, height); - metal_a_supports_paint_setup(0, 4, 10, height, gTrackColours[SCHEME_SUPPORTS]); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15685, 6, 0, 20, 32, 3, height); - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) { - case 0: - paint_util_push_tunnel_right(height + 8, TUNNEL_2); - break; - case 1: - paint_util_push_tunnel_left(height + 8, TUNNEL_2); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void lim_launched_rc_track_left_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lim_launched_rc_track_right_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); -} - -static void lim_launched_rc_track_right_banked_quarter_turn_3_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - lim_launched_rc_track_left_banked_quarter_turn_3_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void lim_launched_rc_track_left_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15658, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15663, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15668, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15673, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15659, 0, 0, 32, 16, 3, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15664, 0, 0, 1, 1, 34, height, 30, 30, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15669, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15674, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15660, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15665, 0, 0, 1, 1, 34, height, 30, 30, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15670, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15675, 0, 0, 16, 16, 3, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 64, 0x20); - break; - case 4: - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 5: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15661, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15666, 0, 0, 1, 1, 34, height, 30, 30, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15671, 0, 0, 1, 32, 34, height, 27, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15676, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15662, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15667, 0, 0, 1, 32, 34, height, 27, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15672, 0, 0, 1, 32, 34, height, 27, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15677, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - } - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 2: - paint_util_push_tunnel_right(height + 8, TUNNEL_2); - break; - case 3: - paint_util_push_tunnel_left(height + 8, TUNNEL_2); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void lim_launched_rc_track_right_banked_quarter_turn_5_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (trackSequence) { - case 0: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15638, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15643, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15648, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15653, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 1: - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 2: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15639, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15644, 0, 0, 32, 16, 3, height, 0, 16, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15649, 0, 0, 1, 1, 34, height, 30, 30, height); - break; - case 3: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15654, 0, 0, 32, 16, 3, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 3: - switch (direction) { - case 0: - sub_98196C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15640, 0, 0, 16, 16, 3, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15645, 0, 0, 16, 16, 3, height, 16, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15650, 0, 0, 1, 1, 34, height, 30, 30, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15655, 0, 0, 16, 16, 3, height, 0, 16, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 64, 0x20); - break; - case 4: - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 5: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15641, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15646, 0, 0, 1, 32, 34, height, 27, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15651, 0, 0, 1, 1, 34, height, 30, 30, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15656, 0, 0, 16, 32, 3, height, 16, 0, height); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - case 6: - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15642, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15647, 0, 0, 1, 32, 34, height, 27, 0, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15652, 0, 0, 1, 32, 34, height, 27, 0, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15657, 0, 0, 20, 32, 3, height, 6, 0, height); - break; - } - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - switch (direction) { - case 0: - paint_util_push_tunnel_right(height + 8, TUNNEL_2); - break; - case 1: - paint_util_push_tunnel_left(height + 8, TUNNEL_2); - break; - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 72, 0x20); - break; - } -} - -static void lim_launched_rc_track_left_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lim_launched_rc_track_right_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction + 1) & 3, height, mapElement); -} - -static void lim_launched_rc_track_right_banked_quarter_turn_5_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - lim_launched_rc_track_left_banked_quarter_turn_5_25_deg_up(rideIndex, trackSequence, (direction - 1) & 3, height, mapElement); -} - -static void lim_launched_rc_track_25_deg_up_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15602, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15603, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15610, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15604, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15605, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); -} - -static void lim_launched_rc_track_25_deg_up_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15606, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15607, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15608, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15611, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15609, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); -} - -static void lim_launched_rc_track_left_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15612, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15613, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15620, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15614, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15615, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); -} - -static void lim_launched_rc_track_right_banked_25_deg_up_to_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15616, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15617, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15618, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15621, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15619, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 8, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_1); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 56, 0x20); -} - -static void lim_launched_rc_track_25_deg_down_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_right_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_25_deg_down_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_left_banked_25_deg_up_to_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_left_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_25_deg_up_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_right_banked_25_deg_down_to_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_25_deg_up_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_left_banked_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15622, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15623, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15624, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15625, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } else { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); -} - -static void lim_launched_rc_track_right_banked_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15626, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15627, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15628, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15629, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } else { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); -} - -static void lim_launched_rc_track_left_banked_25_deg_up_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15630, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15631, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15632, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15633, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 40, 0x20); -} - -static void lim_launched_rc_track_right_banked_25_deg_up_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15634, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15635, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15636, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15637, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 40, 0x20); -} - -static void lim_launched_rc_track_left_banked_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_right_banked_25_deg_up_to_right_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_right_banked_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_left_banked_25_deg_up_to_left_banked_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_left_banked_25_deg_down_to_left_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_right_banked_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_right_banked_25_deg_down_to_right_banked_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_left_banked_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_flat_to_left_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15574, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15575, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15582, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15576, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15577, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } else { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); -} - -static void lim_launched_rc_track_flat_to_right_banked_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15578, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15579, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15580, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15583, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15581, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 3, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_0); - } else { - paint_util_push_tunnel_rotated(direction, height, TUNNEL_2); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 48, 0x20); -} - -static void lim_launched_rc_track_left_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15584, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15585, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15592, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15586, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15587, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 40, 0x20); -} - -static void lim_launched_rc_track_right_banked_25_deg_up_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - switch (direction) { - case 0: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15588, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 1: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15589, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - case 2: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15590, 0, 0, 32, 20, 3, height, 0, 6, height); - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15593, 0, 0, 32, 1, 34, height, 0, 27, height); - break; - case 3: - sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 15591, 0, 0, 32, 20, 3, height, 0, 6, height); - break; - } - if (track_paint_util_should_paint_supports(gPaintMapPosition)) { - metal_a_supports_paint_setup(0, 4, 6, height, gTrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) { - paint_util_push_tunnel_rotated(direction, height - 8, TUNNEL_0); - } else { - paint_util_push_tunnel_rotated(direction, height + 8, TUNNEL_12); - } - paint_util_set_segment_support_height(paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - paint_util_set_general_support_height(height + 40, 0x20); -} - -static void lim_launched_rc_track_flat_to_left_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_right_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_flat_to_right_banked_25_deg_down(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_left_banked_25_deg_up_to_flat(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_left_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_flat_to_right_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - -static void lim_launched_rc_track_right_banked_25_deg_down_to_flat(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) -{ - lim_launched_rc_track_flat_to_left_banked_25_deg_up(rideIndex, trackSequence, (direction + 2) & 3, height, mapElement); -} - static void lim_launched_rc_track_left_quarter_turn_1_90_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { switch (trackSequence) { From e902d5d82f3c2c3dd7dd27ba7b62383cafef9a3f Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 23:49:22 +0100 Subject: [PATCH 50/55] Fix stand up roller coaster painting --- src/ride/coaster/stand_up_roller_coaster.c | 33 ++++++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/ride/coaster/stand_up_roller_coaster.c b/src/ride/coaster/stand_up_roller_coaster.c index 3dc6aa12b3..f1912687c3 100644 --- a/src/ride/coaster/stand_up_roller_coaster.c +++ b/src/ride/coaster/stand_up_roller_coaster.c @@ -66,6 +66,28 @@ static void stand_up_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 d paint_util_set_general_support_height(height + 32, 0x20); } +static void stand_up_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { 25567, 25571, SPR_STATION_BASE_A_SW_NE }, + { 25568, 25572, SPR_STATION_BASE_A_NW_SE }, + { 25567, 25571, SPR_STATION_BASE_A_SW_NE }, + { 25568, 25572, SPR_STATION_BASE_A_NW_SE }, + }; + + if (mapElement->properties.track.type == TRACK_ELEM_END_STATION) { + sub_98197C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_TRACK], 0, 6, 32, 20, 1, height, 0, 6, height + 3); + } else { + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 6, 32, 20, 1, height, 0, 6, height + 3); + } + sub_98196C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 0); + track_paint_util_draw_station_2(rideIndex, trackSequence, direction, height, mapElement, 9, 11); + 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 stand_up_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -3305,32 +3327,27 @@ static void stand_up_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25229, 0, 6, 32, 20, 1, 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(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25230, 0, 6, 32, 20, 1, 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(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25229, 0, 6, 32, 20, 1, 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(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 25230, 0, 6, 32, 20, 1, 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_0); paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); paint_util_set_general_support_height(height + 48, 0x20); @@ -5707,6 +5724,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_stand_up_rc(int trackType, int dir switch (trackType) { case TRACK_ELEM_FLAT: return stand_up_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return stand_up_rc_track_station; case TRACK_ELEM_25_DEG_UP: return stand_up_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: From 374969ad3f596ba3109610d4a335e85aad41a63c Mon Sep 17 00:00:00 2001 From: Ted John Date: Sun, 9 Oct 2016 23:52:40 +0100 Subject: [PATCH 51/55] Fix steeplechase painting --- src/ride/coaster/steeplechase.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/ride/coaster/steeplechase.c b/src/ride/coaster/steeplechase.c index 634ee567df..e616d56874 100644 --- a/src/ride/coaster/steeplechase.c +++ b/src/ride/coaster/steeplechase.c @@ -60,6 +60,24 @@ static void steeplechase_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 paint_util_set_general_support_height(height + 32, 0x20); } +static void steeplechase_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { 28635, SPR_STATION_BASE_B_SW_NE }, + { 28636, SPR_STATION_BASE_B_NW_SE }, + { 28635, SPR_STATION_BASE_B_SW_NE }, + { 28636, SPR_STATION_BASE_B_NW_SE }, + }; + + sub_98197C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_MISC], 0, 0, 32, 28, 3, height - 2, 0, 2, height); + sub_98199C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 6, 32, 20, 3, height, 0, 0, height); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 3); + track_paint_util_draw_station(rideIndex, trackSequence, direction, height, 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 + 32, 0x20); +} + static void steeplechase_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -1541,6 +1559,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_steeplechase(int trackType, int di switch (trackType) { case TRACK_ELEM_FLAT: return steeplechase_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return steeplechase_track_station; case TRACK_ELEM_25_DEG_UP: return steeplechase_track_25_deg_up; case TRACK_ELEM_FLAT_TO_25_DEG_UP: From 834995545d87e2ee170b79dea5cf440e4b147b60 Mon Sep 17 00:00:00 2001 From: Ted John Date: Mon, 10 Oct 2016 00:00:02 +0100 Subject: [PATCH 52/55] Fix suspended swinging coaster painting --- src/ride/coaster/suspended_swinging_coaster.c | 23 +++++++++++++++++++ src/ride/track_paint.h | 3 ++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/ride/coaster/suspended_swinging_coaster.c b/src/ride/coaster/suspended_swinging_coaster.c index b4e658afc2..4fcfc2ae10 100644 --- a/src/ride/coaster/suspended_swinging_coaster.c +++ b/src/ride/coaster/suspended_swinging_coaster.c @@ -62,6 +62,25 @@ static void suspended_swinging_rc_track_flat(uint8 rideIndex, uint8 trackSequenc paint_util_set_general_support_height(height + 48, 0x20); } +static void suspended_swinging_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { SPR_STATION_BASE_C_SW_NE, 25963, SPR_STATION_INVERTED_BAR_D_SW_NE }, + { SPR_STATION_BASE_C_NW_SE, 25964, SPR_STATION_INVERTED_BAR_D_NW_SE }, + { SPR_STATION_BASE_C_SW_NE, 25963, SPR_STATION_INVERTED_BAR_D_SW_NE }, + { SPR_STATION_BASE_C_NW_SE, 25964, SPR_STATION_INVERTED_BAR_D_NW_SE }, + }; + + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_MISC], 0, 0, 32, 28, 1, height, 0, 2, height); + sub_98197C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 3, height + 29, 0, 6, height + 29); + sub_98199C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 3, height + 29, 0, 6, height + 29); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 0); + track_paint_util_draw_station_inverted(rideIndex, trackSequence, direction, height, mapElement); + paint_util_push_tunnel_rotated(direction, height, TUNNEL_9); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + static void suspended_swinging_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -2838,6 +2857,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_suspended_swinging_rc(int trackTyp switch (trackType) { case TRACK_ELEM_FLAT: return suspended_swinging_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return suspended_swinging_rc_track_station; case TRACK_ELEM_25_DEG_UP: return suspended_swinging_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index e663add740..16b072db5a 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -127,7 +127,8 @@ enum { SPR_STATION_INVERTED_LIGHT_BACK_ANGLE_FENCED_NW_SE = 22397, SPR_STATION_INVERTED_BAR_C_SW_NE = 22398, SPR_STATION_INVERTED_BAR_C_NW_SE = 22399, - + SPR_STATION_INVERTED_BAR_D_SW_NE = 22400, + SPR_STATION_INVERTED_BAR_D_NW_SE = 22401, SPR_STATION_INVERTED_BAR_E_SW_NE = 22402, SPR_STATION_INVERTED_BAR_E_NW_SE = 22403, From 42d14f62fed8ea7d64d047e74cf4939d9340f0fb Mon Sep 17 00:00:00 2001 From: Ted John Date: Mon, 10 Oct 2016 00:03:40 +0100 Subject: [PATCH 53/55] Fix twister roller coaster painting --- src/ride/coaster/twister_roller_coaster.c | 36 +++++++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/src/ride/coaster/twister_roller_coaster.c b/src/ride/coaster/twister_roller_coaster.c index 7e8c026836..334a300401 100644 --- a/src/ride/coaster/twister_roller_coaster.c +++ b/src/ride/coaster/twister_roller_coaster.c @@ -66,6 +66,31 @@ static void twister_rc_track_flat(uint8 rideIndex, uint8 trackSequence, uint8 di paint_util_set_general_support_height(height + 32, 0x20); } +static void twister_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { 17154, 17150, SPR_STATION_BASE_A_SW_NE }, + { 17155, 17151, SPR_STATION_BASE_A_NW_SE }, + { 17154, 17150, SPR_STATION_BASE_A_SW_NE }, + { 17155, 17151, SPR_STATION_BASE_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, 20, 1, height, 0, 6, height + 3); + } else { + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); + } + sub_98196C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 0); + + rct_ride * ride = get_ride(rideIndex); + track_paint_util_draw_station_platform(ride, direction, height, 9, 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 + 32, 0x20); +} + static void twister_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -3222,32 +3247,27 @@ static void twister_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSequence, metal_a_supports_paint_setup(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17146, 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(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17147, 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(0, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17146, 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(0, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(0, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17147, 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); @@ -7651,6 +7671,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_twister_rc(int trackType, int dire switch (trackType) { case TRACK_ELEM_FLAT: return twister_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return twister_rc_track_station; case TRACK_ELEM_25_DEG_UP: return twister_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: From 7c0935f341470313739519807c5981a84c04a426 Mon Sep 17 00:00:00 2001 From: Ted John Date: Mon, 10 Oct 2016 00:05:58 +0100 Subject: [PATCH 54/55] Fix vertical drop roller coaster painting --- .../coaster/vertical_drop_roller_coaster.c | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/src/ride/coaster/vertical_drop_roller_coaster.c b/src/ride/coaster/vertical_drop_roller_coaster.c index 51e160eb99..5053dfb74c 100644 --- a/src/ride/coaster/vertical_drop_roller_coaster.c +++ b/src/ride/coaster/vertical_drop_roller_coaster.c @@ -66,6 +66,31 @@ static void vertical_drop_rc_track_flat(uint8 rideIndex, uint8 trackSequence, ui paint_util_set_general_support_height(height + 32, 0x20); } +static void vertical_drop_rc_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { 17154, 17150, SPR_STATION_BASE_A_SW_NE }, + { 17155, 17151, SPR_STATION_BASE_A_NW_SE }, + { 17154, 17150, SPR_STATION_BASE_A_SW_NE }, + { 17155, 17151, SPR_STATION_BASE_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, 20, 1, height, 0, 6, height + 3); + } else { + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 1, height, 0, 6, height + 3); + } + sub_98196C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_MISC], 0, 0, 32, 32, 1, height); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 3); + + rct_ride * ride = get_ride(rideIndex); + track_paint_util_draw_station_platform(ride, direction, height, 9, 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 + 32, 0x20); +} + static void vertical_drop_rc_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { if (track_element_is_lift_hill(mapElement)) { @@ -3081,32 +3106,27 @@ static void vertical_drop_rc_track_on_ride_photo(uint8 rideIndex, uint8 trackSeq metal_a_supports_paint_setup(3, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(3, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17146, 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(3, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(3, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17147, 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(3, 5, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(3, 8, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17146, 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(3, 6, 0, height, gTrackColours[SCHEME_SUPPORTS]); metal_a_supports_paint_setup(3, 7, 0, height, gTrackColours[SCHEME_SUPPORTS]); sub_98197C_rotated(direction, gTrackColours[SCHEME_TRACK] | 17147, 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); @@ -7126,6 +7146,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_vertical_drop_rc(int trackType, in switch (trackType) { case TRACK_ELEM_FLAT: return vertical_drop_rc_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return vertical_drop_rc_track_station; case TRACK_ELEM_25_DEG_UP: return vertical_drop_rc_track_25_deg_up; case TRACK_ELEM_60_DEG_UP: From 3cedd8afa3d57fb466548b71f4b92928612683a3 Mon Sep 17 00:00:00 2001 From: Ted John Date: Mon, 10 Oct 2016 00:10:01 +0100 Subject: [PATCH 55/55] Fix suspended monorail painting --- src/ride/track_paint.h | 5 ++--- src/ride/transport/suspended_monorail.c | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/ride/track_paint.h b/src/ride/track_paint.h index 16b072db5a..fb71e1e9f3 100644 --- a/src/ride/track_paint.h +++ b/src/ride/track_paint.h @@ -122,7 +122,6 @@ enum { SPR_STATION_INVERTED_FENCE_NW_SE = 22393, SPR_STATION_INVERTED_BEGIN_ANGLE_FENCE_SW_NE = 22394, SPR_STATION_INVERTED_BEGIN_ANGLE_FENCE_NW_SE = 22395, - SPR_STATION_INVERTED_LIGHT_BACK_ANGLE_FENCED_NE_SW = 22396, SPR_STATION_INVERTED_LIGHT_BACK_ANGLE_FENCED_NW_SE = 22397, SPR_STATION_INVERTED_BAR_C_SW_NE = 22398, @@ -131,7 +130,6 @@ enum { SPR_STATION_INVERTED_BAR_D_NW_SE = 22401, SPR_STATION_INVERTED_BAR_E_SW_NE = 22402, SPR_STATION_INVERTED_BAR_E_NW_SE = 22403, - SPR_STATION_PIER_EDGE_SE = 22404, SPR_STATION_PIER_EDGE_SW = 22405, SPR_STATION_PIER_EDGE_NW = 22406, @@ -146,7 +144,8 @@ enum { SPR_STATION_NARROW_EDGE_FENCED_NE = 22415, SPR_STATION_NARROW_EDGE_NW = 22416, SPR_STATION_NARROW_EDGE_NE = 22417, - + SPR_STATION_INVERTED_BAR_F_SW_NE = 22418, + SPR_STATION_INVERTED_BAR_F_NW_SE = 22419, SPR_STATION_INVERTED_BAR_0_SW_NE = 22420, SPR_STATION_INVERTED_BAR_0_NW_SE = 22421, SPR_STATION_INVERTED_BAR_A_SW_NE = 22422, diff --git a/src/ride/transport/suspended_monorail.c b/src/ride/transport/suspended_monorail.c index 6687382e15..c1d81e7a2a 100644 --- a/src/ride/transport/suspended_monorail.c +++ b/src/ride/transport/suspended_monorail.c @@ -46,6 +46,25 @@ static void suspended_monorail_track_flat(uint8 rideIndex, uint8 trackSequence, paint_util_set_general_support_height(height + 48, 0x20); } +static void suspended_monorail_track_station(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) +{ + static const uint32 imageIds[4][3] = { + { SPR_STATION_BASE_C_SW_NE, 25853, SPR_STATION_INVERTED_BAR_F_SW_NE }, + { SPR_STATION_BASE_C_NW_SE, 25854, SPR_STATION_INVERTED_BAR_F_NW_SE }, + { SPR_STATION_BASE_C_SW_NE, 25853, SPR_STATION_INVERTED_BAR_F_SW_NE }, + { SPR_STATION_BASE_C_NW_SE, 25854, SPR_STATION_INVERTED_BAR_F_NW_SE }, + }; + + sub_98197C_rotated(direction, imageIds[direction][0] | gTrackColours[SCHEME_MISC], 0, 0, 32, 28, 1, height, 0, 2, height); + sub_98197C_rotated(direction, imageIds[direction][1] | gTrackColours[SCHEME_TRACK], 0, 0, 32, 20, 3, height + 32, 0, 6, height + 32); + sub_98199C_rotated(direction, imageIds[direction][2] | gTrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 3, height + 32, 0, 6, height + 32); + track_paint_util_draw_station_metal_supports_2(direction, height, gTrackColours[SCHEME_SUPPORTS], 3); + track_paint_util_draw_station_inverted(rideIndex, trackSequence, direction, height, mapElement); + paint_util_push_tunnel_rotated(direction, height, TUNNEL_9); + paint_util_set_segment_support_height(SEGMENTS_ALL, 0xFFFF, 0); + paint_util_set_general_support_height(height + 48, 0x20); +} + static void suspended_monorail_track_25_deg_up(uint8 rideIndex, uint8 trackSequence, uint8 direction, int height, rct_map_element * mapElement) { switch (direction) { @@ -1126,6 +1145,10 @@ TRACK_PAINT_FUNCTION get_track_paint_function_suspended_monorail(int trackType, switch (trackType) { case TRACK_ELEM_FLAT: return suspended_monorail_track_flat; + case TRACK_ELEM_END_STATION: + case TRACK_ELEM_BEGIN_STATION: + case TRACK_ELEM_MIDDLE_STATION: + return suspended_monorail_track_station; case TRACK_ELEM_25_DEG_UP: return suspended_monorail_track_25_deg_up; case TRACK_ELEM_FLAT_TO_25_DEG_UP: