1 /*****************************************************************************
2  * Copyright (c) 2014-2020 OpenRCT2 developers
3  *
4  * For a complete list of all authors, please refer to contributors.md
5  * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
6  *
7  * OpenRCT2 is licensed under the GNU General Public License version 3.
8  *****************************************************************************/
9 
10 #include "../../drawing/Drawing.h"
11 #include "../../interface/Viewport.h"
12 #include "../../paint/Paint.h"
13 #include "../../paint/Supports.h"
14 #include "../../paint/tile_element/Paint.TileElement.h"
15 #include "../../sprites.h"
16 #include "../../world/Map.h"
17 #include "../RideData.h"
18 #include "../TrackData.h"
19 #include "../TrackPaint.h"
20 
21 /** rct2: 0x008AFE9C */
mini_suspended_rc_track_flat(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)22 static void mini_suspended_rc_track_flat(
23     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
24     const TrackElement& trackElement)
25 {
26     if (trackElement.HasChain())
27     {
28         switch (direction)
29         {
30             case 0:
31             case 2:
32                 PaintAddImageAsParentRotated(
33                     session, direction, session->TrackColours[SCHEME_TRACK] | 28433, 0, 6, 32, 20, 1, height + 24);
34                 break;
35             case 1:
36             case 3:
37                 PaintAddImageAsParentRotated(
38                     session, direction, session->TrackColours[SCHEME_TRACK] | 28434, 0, 6, 32, 20, 1, height + 24);
39                 break;
40         }
41     }
42     else
43     {
44         switch (direction)
45         {
46             case 0:
47             case 2:
48                 PaintAddImageAsParentRotated(
49                     session, direction, session->TrackColours[SCHEME_TRACK] | 28383, 0, 6, 32, 20, 1, height + 24);
50                 break;
51             case 1:
52             case 3:
53                 PaintAddImageAsParentRotated(
54                     session, direction, session->TrackColours[SCHEME_TRACK] | 28384, 0, 6, 32, 20, 1, height + 24);
55                 break;
56         }
57     }
58 
59     paint_util_set_segment_support_height(
60         session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
61     if (track_paint_util_should_paint_supports(session->MapPosition))
62     {
63         switch (direction)
64         {
65             case 0:
66             case 2:
67                 metal_a_supports_paint_setup(
68                     session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
69                 break;
70             case 1:
71             case 3:
72                 metal_a_supports_paint_setup(
73                     session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
74                 break;
75         }
76     }
77 
78     paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0);
79     paint_util_set_general_support_height(session, height + 48, 0x20);
80 }
81 
82 /** rct2: 0x008AFF4C, 0x008AFF5C, 0x008AFF6C */
mini_suspended_rc_track_station(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)83 static void mini_suspended_rc_track_station(
84     paint_session* session, const Ride* ride, [[maybe_unused]] uint8_t trackSequence, uint8_t direction, int32_t height,
85     const TrackElement& trackElement)
86 {
87     static constexpr const uint32_t imageIds[4][3] = {
88         { SPR_STATION_BASE_C_SW_NE, 28433, SPR_STATION_INVERTED_BAR_E_SW_NE },
89         { SPR_STATION_BASE_C_NW_SE, 28434, SPR_STATION_INVERTED_BAR_E_NW_SE },
90         { SPR_STATION_BASE_C_SW_NE, 28433, SPR_STATION_INVERTED_BAR_E_SW_NE },
91         { SPR_STATION_BASE_C_NW_SE, 28434, SPR_STATION_INVERTED_BAR_E_NW_SE },
92     };
93 
94     PaintAddImageAsParentRotated(
95         session, direction, imageIds[direction][0] | session->TrackColours[SCHEME_MISC], 0, 0, 32, 28, 1, height, 0, 2, height);
96     PaintAddImageAsParentRotated(
97         session, direction, imageIds[direction][1] | session->TrackColours[SCHEME_TRACK], 0, 6, 32, 20, 1, height + 24);
98     PaintAddImageAsChildRotated(
99         session, direction, imageIds[direction][2] | session->TrackColours[SCHEME_SUPPORTS], 0, 6, 32, 20, 1, height + 24, 0, 2,
100         height);
101     track_paint_util_draw_station_metal_supports_2(session, direction, height, session->TrackColours[SCHEME_SUPPORTS], 3);
102     track_paint_util_draw_station_inverted(session, ride, direction, height, trackElement, STATION_VARIANT_1);
103     paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_SQUARE_FLAT);
104     paint_util_set_segment_support_height(session, SEGMENTS_ALL, 0xFFFF, 0);
105     paint_util_set_general_support_height(session, height + 32, 0x20);
106 }
107 
108 /** rct2: 0x008AFEAC */
mini_suspended_rc_track_25_deg_up(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)109 static void mini_suspended_rc_track_25_deg_up(
110     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
111     const TrackElement& trackElement)
112 {
113     if (trackElement.HasChain())
114     {
115         switch (direction)
116         {
117             case 0:
118                 PaintAddImageAsParentRotated(
119                     session, direction, session->TrackColours[SCHEME_TRACK] | 28435, 0, 6, 32, 20, 1, height + 24, 0, 6,
120                     height + 40);
121                 break;
122             case 1:
123                 PaintAddImageAsParentRotated(
124                     session, direction, session->TrackColours[SCHEME_TRACK] | 28441, 0, 6, 32, 20, 1, height + 24, 0, 6,
125                     height + 40);
126                 break;
127             case 2:
128                 PaintAddImageAsParentRotated(
129                     session, direction, session->TrackColours[SCHEME_TRACK] | 28437, 0, 6, 32, 20, 1, height + 24, 0, 6,
130                     height + 40);
131                 break;
132             case 3:
133                 PaintAddImageAsParentRotated(
134                     session, direction, session->TrackColours[SCHEME_TRACK] | 28442, 0, 6, 32, 20, 1, height + 24, 0, 6,
135                     height + 40);
136                 break;
137         }
138     }
139     else
140     {
141         switch (direction)
142         {
143             case 0:
144                 PaintAddImageAsParentRotated(
145                     session, direction, session->TrackColours[SCHEME_TRACK] | 28385, 0, 6, 32, 20, 1, height + 24, 0, 6,
146                     height + 40);
147                 break;
148             case 1:
149                 PaintAddImageAsParentRotated(
150                     session, direction, session->TrackColours[SCHEME_TRACK] | 28391, 0, 6, 32, 20, 1, height + 24, 0, 6,
151                     height + 40);
152                 break;
153             case 2:
154                 PaintAddImageAsParentRotated(
155                     session, direction, session->TrackColours[SCHEME_TRACK] | 28387, 0, 6, 32, 20, 1, height + 24, 0, 6,
156                     height + 40);
157                 break;
158             case 3:
159                 PaintAddImageAsParentRotated(
160                     session, direction, session->TrackColours[SCHEME_TRACK] | 28392, 0, 6, 32, 20, 1, height + 24, 0, 6,
161                     height + 40);
162                 break;
163         }
164     }
165 
166     paint_util_set_segment_support_height(
167         session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
168     if (track_paint_util_should_paint_supports(session->MapPosition))
169     {
170         switch (direction)
171         {
172             case 0:
173                 metal_a_supports_paint_setup(
174                     session, METAL_SUPPORTS_FORK, 6, 0, height + 46, session->TrackColours[SCHEME_SUPPORTS]);
175                 break;
176             case 1:
177                 metal_a_supports_paint_setup(
178                     session, METAL_SUPPORTS_FORK_ALT, 8, 0, height + 46, session->TrackColours[SCHEME_SUPPORTS]);
179                 break;
180             case 2:
181                 metal_a_supports_paint_setup(
182                     session, METAL_SUPPORTS_FORK, 7, 0, height + 46, session->TrackColours[SCHEME_SUPPORTS]);
183                 break;
184             case 3:
185                 metal_a_supports_paint_setup(
186                     session, METAL_SUPPORTS_FORK_ALT, 5, 0, height + 46, session->TrackColours[SCHEME_SUPPORTS]);
187                 break;
188         }
189     }
190 
191     if (direction == 0 || direction == 3)
192     {
193         paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_1);
194     }
195     else
196     {
197         paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_2);
198     }
199     paint_util_set_general_support_height(session, height + 72, 0x20);
200 }
201 
202 /** rct2: 0x008AFEBC */
mini_suspended_rc_track_flat_to_25_deg_up(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)203 static void mini_suspended_rc_track_flat_to_25_deg_up(
204     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
205     const TrackElement& trackElement)
206 {
207     if (trackElement.HasChain())
208     {
209         switch (direction)
210         {
211             case 0:
212                 PaintAddImageAsParentRotated(
213                     session, direction, session->TrackColours[SCHEME_TRACK] | 28436, 0, 6, 32, 20, 1, height + 24, 0, 6,
214                     height + 32);
215                 break;
216             case 1:
217                 PaintAddImageAsParentRotated(
218                     session, direction, session->TrackColours[SCHEME_TRACK] | 28443, 0, 6, 32, 20, 1, height + 24, 0, 6,
219                     height + 32);
220                 break;
221             case 2:
222                 PaintAddImageAsParentRotated(
223                     session, direction, session->TrackColours[SCHEME_TRACK] | 28438, 0, 6, 32, 20, 1, height + 24, 0, 6,
224                     height + 32);
225                 break;
226             case 3:
227                 PaintAddImageAsParentRotated(
228                     session, direction, session->TrackColours[SCHEME_TRACK] | 28444, 0, 6, 32, 20, 1, height + 24, 0, 6,
229                     height + 32);
230                 break;
231         }
232     }
233     else
234     {
235         switch (direction)
236         {
237             case 0:
238                 PaintAddImageAsParentRotated(
239                     session, direction, session->TrackColours[SCHEME_TRACK] | 28386, 0, 6, 32, 20, 1, height + 24, 0, 6,
240                     height + 32);
241                 break;
242             case 1:
243                 PaintAddImageAsParentRotated(
244                     session, direction, session->TrackColours[SCHEME_TRACK] | 28393, 0, 6, 32, 20, 1, height + 24, 0, 6,
245                     height + 32);
246                 break;
247             case 2:
248                 PaintAddImageAsParentRotated(
249                     session, direction, session->TrackColours[SCHEME_TRACK] | 28388, 0, 6, 32, 20, 1, height + 24, 0, 6,
250                     height + 32);
251                 break;
252             case 3:
253                 PaintAddImageAsParentRotated(
254                     session, direction, session->TrackColours[SCHEME_TRACK] | 28394, 0, 6, 32, 20, 1, height + 24, 0, 6,
255                     height + 32);
256                 break;
257         }
258     }
259 
260     paint_util_set_segment_support_height(
261         session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
262     if (track_paint_util_should_paint_supports(session->MapPosition))
263     {
264         switch (direction)
265         {
266             case 0:
267                 metal_a_supports_paint_setup(
268                     session, METAL_SUPPORTS_FORK, 6, 0, height + 38, session->TrackColours[SCHEME_SUPPORTS]);
269                 break;
270             case 1:
271                 metal_a_supports_paint_setup(
272                     session, METAL_SUPPORTS_FORK_ALT, 8, 0, height + 38, session->TrackColours[SCHEME_SUPPORTS]);
273                 break;
274             case 2:
275                 metal_a_supports_paint_setup(
276                     session, METAL_SUPPORTS_FORK, 7, 0, height + 38, session->TrackColours[SCHEME_SUPPORTS]);
277                 break;
278             case 3:
279                 metal_a_supports_paint_setup(
280                     session, METAL_SUPPORTS_FORK_ALT, 5, 0, height + 38, session->TrackColours[SCHEME_SUPPORTS]);
281                 break;
282         }
283     }
284 
285     if (direction == 0 || direction == 3)
286     {
287         paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0);
288     }
289     else
290     {
291         paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_2);
292     }
293     paint_util_set_general_support_height(session, height + 64, 0x20);
294 }
295 
296 /** rct2: 0x008AFECC */
mini_suspended_rc_track_25_deg_up_to_flat(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)297 static void mini_suspended_rc_track_25_deg_up_to_flat(
298     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
299     const TrackElement& trackElement)
300 {
301     if (trackElement.HasChain())
302     {
303         switch (direction)
304         {
305             case 0:
306                 PaintAddImageAsParentRotated(
307                     session, direction, session->TrackColours[SCHEME_TRACK] | 28440, 0, 6, 32, 20, 1, height + 24, 0, 6,
308                     height + 32);
309                 break;
310             case 1:
311                 PaintAddImageAsParentRotated(
312                     session, direction, session->TrackColours[SCHEME_TRACK] | 28446, 0, 6, 32, 20, 1, height + 24, 0, 6,
313                     height + 32);
314                 break;
315             case 2:
316                 PaintAddImageAsParentRotated(
317                     session, direction, session->TrackColours[SCHEME_TRACK] | 28439, 0, 6, 32, 20, 1, height + 24, 0, 6,
318                     height + 32);
319                 break;
320             case 3:
321                 PaintAddImageAsParentRotated(
322                     session, direction, session->TrackColours[SCHEME_TRACK] | 28445, 0, 6, 32, 20, 1, height + 24, 0, 6,
323                     height + 32);
324                 break;
325         }
326     }
327     else
328     {
329         switch (direction)
330         {
331             case 0:
332                 PaintAddImageAsParentRotated(
333                     session, direction, session->TrackColours[SCHEME_TRACK] | 28390, 0, 6, 32, 20, 1, height + 24, 0, 6,
334                     height + 32);
335                 break;
336             case 1:
337                 PaintAddImageAsParentRotated(
338                     session, direction, session->TrackColours[SCHEME_TRACK] | 28396, 0, 6, 32, 20, 1, height + 24, 0, 6,
339                     height + 32);
340                 break;
341             case 2:
342                 PaintAddImageAsParentRotated(
343                     session, direction, session->TrackColours[SCHEME_TRACK] | 28389, 0, 6, 32, 20, 1, height + 24, 0, 6,
344                     height + 32);
345                 break;
346             case 3:
347                 PaintAddImageAsParentRotated(
348                     session, direction, session->TrackColours[SCHEME_TRACK] | 28395, 0, 6, 32, 20, 1, height + 24, 0, 6,
349                     height + 32);
350                 break;
351         }
352     }
353 
354     paint_util_set_segment_support_height(
355         session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
356     if (track_paint_util_should_paint_supports(session->MapPosition))
357     {
358         switch (direction)
359         {
360             case 0:
361                 metal_a_supports_paint_setup(
362                     session, METAL_SUPPORTS_FORK, 6, 0, height + 38, session->TrackColours[SCHEME_SUPPORTS]);
363                 break;
364             case 1:
365                 metal_a_supports_paint_setup(
366                     session, METAL_SUPPORTS_FORK_ALT, 8, 0, height + 38, session->TrackColours[SCHEME_SUPPORTS]);
367                 break;
368             case 2:
369                 metal_a_supports_paint_setup(
370                     session, METAL_SUPPORTS_FORK, 7, 0, height + 38, session->TrackColours[SCHEME_SUPPORTS]);
371                 break;
372             case 3:
373                 metal_a_supports_paint_setup(
374                     session, METAL_SUPPORTS_FORK_ALT, 5, 0, height + 38, session->TrackColours[SCHEME_SUPPORTS]);
375                 break;
376         }
377     }
378 
379     if (direction == 0 || direction == 3)
380     {
381         paint_util_push_tunnel_rotated(session, direction, height - 8, TUNNEL_0);
382     }
383     else
384     {
385         paint_util_push_tunnel_rotated(session, direction, height + 8, TUNNEL_12);
386     }
387     paint_util_set_general_support_height(session, height + 56, 0x20);
388 }
389 
390 /** rct2: 0x008AFEDC */
mini_suspended_rc_track_25_deg_down(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)391 static void mini_suspended_rc_track_25_deg_down(
392     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
393     const TrackElement& trackElement)
394 {
395     mini_suspended_rc_track_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement);
396 }
397 
398 /** rct2: 0x008AFEEC */
mini_suspended_rc_track_flat_to_25_deg_down(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)399 static void mini_suspended_rc_track_flat_to_25_deg_down(
400     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
401     const TrackElement& trackElement)
402 {
403     mini_suspended_rc_track_25_deg_up_to_flat(session, ride, trackSequence, (direction + 2) & 3, height, trackElement);
404 }
405 
406 /** rct2: 0x008AFEFC */
mini_suspended_rc_track_25_deg_down_to_flat(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)407 static void mini_suspended_rc_track_25_deg_down_to_flat(
408     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
409     const TrackElement& trackElement)
410 {
411     mini_suspended_rc_track_flat_to_25_deg_up(session, ride, trackSequence, (direction + 2) & 3, height, trackElement);
412 }
413 
414 /** rct2: 0x008AFF0C */
mini_suspended_rc_track_left_quarter_turn_5(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)415 static void mini_suspended_rc_track_left_quarter_turn_5(
416     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
417     const TrackElement& trackElement)
418 {
419     switch (trackSequence)
420     {
421         case 0:
422             switch (direction)
423             {
424                 case 0:
425                     PaintAddImageAsParentRotated(
426                         session, direction, session->TrackColours[SCHEME_TRACK] | 28406, 0, 6, 32, 20, 1, height + 24);
427                     break;
428                 case 1:
429                     PaintAddImageAsParentRotated(
430                         session, direction, session->TrackColours[SCHEME_TRACK] | 28411, 0, 6, 32, 20, 1, height + 24);
431                     break;
432                 case 2:
433                     PaintAddImageAsParentRotated(
434                         session, direction, session->TrackColours[SCHEME_TRACK] | 28416, 0, 6, 32, 20, 1, height + 24);
435                     break;
436                 case 3:
437                     PaintAddImageAsParentRotated(
438                         session, direction, session->TrackColours[SCHEME_TRACK] | 28401, 0, 6, 32, 20, 1, height + 24);
439                     break;
440             }
441 
442             paint_util_set_segment_support_height(
443                 session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
444                 0xFFFF, 0);
445             switch (direction)
446             {
447                 case 0:
448                 case 2:
449                     metal_a_supports_paint_setup(
450                         session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
451                     break;
452                 case 1:
453                 case 3:
454                     metal_a_supports_paint_setup(
455                         session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
456                     break;
457             }
458 
459             if (direction == 0 || direction == 3)
460             {
461                 paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0);
462             }
463             paint_util_set_general_support_height(session, height + 48, 0x20);
464             break;
465         case 1:
466             paint_util_set_general_support_height(session, height + 48, 0x20);
467             break;
468         case 2:
469             switch (direction)
470             {
471                 case 0:
472                     PaintAddImageAsParentRotated(
473                         session, direction, session->TrackColours[SCHEME_TRACK] | 28405, 0, 0, 32, 16, 1, height + 24);
474                     break;
475                 case 1:
476                     PaintAddImageAsParentRotated(
477                         session, direction, session->TrackColours[SCHEME_TRACK] | 28410, 0, 0, 32, 16, 1, height + 24);
478                     break;
479                 case 2:
480                     PaintAddImageAsParentRotated(
481                         session, direction, session->TrackColours[SCHEME_TRACK] | 28415, 0, 16, 32, 16, 1, height + 24);
482                     break;
483                 case 3:
484                     PaintAddImageAsParentRotated(
485                         session, direction, session->TrackColours[SCHEME_TRACK] | 28400, 0, 16, 32, 16, 1, height + 24);
486                     break;
487             }
488             paint_util_set_segment_support_height(
489                 session,
490                 paint_util_rotate_segments(
491                     SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
492                 0xFFFF, 0);
493             paint_util_set_general_support_height(session, height + 48, 0x20);
494             break;
495         case 3:
496             switch (direction)
497             {
498                 case 0:
499                     PaintAddImageAsParentRotated(
500                         session, direction, session->TrackColours[SCHEME_TRACK] | 28404, 0, 16, 16, 16, 1, height + 24);
501                     break;
502                 case 1:
503                     PaintAddImageAsParentRotated(
504                         session, direction, session->TrackColours[SCHEME_TRACK] | 28409, 16, 16, 16, 16, 1, height + 24);
505                     break;
506                 case 2:
507                     PaintAddImageAsParentRotated(
508                         session, direction, session->TrackColours[SCHEME_TRACK] | 28414, 16, 0, 16, 16, 1, height + 24);
509                     break;
510                 case 3:
511                     PaintAddImageAsParentRotated(
512                         session, direction, session->TrackColours[SCHEME_TRACK] | 28399, 0, 0, 16, 16, 1, height + 24);
513                     break;
514             }
515             paint_util_set_segment_support_height(
516                 session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
517             paint_util_set_general_support_height(session, height + 48, 0x20);
518             break;
519         case 4:
520             paint_util_set_general_support_height(session, height + 48, 0x20);
521             break;
522         case 5:
523             switch (direction)
524             {
525                 case 0:
526                     PaintAddImageAsParentRotated(
527                         session, direction, session->TrackColours[SCHEME_TRACK] | 28403, 16, 0, 16, 32, 1, height + 24);
528                     break;
529                 case 1:
530                     PaintAddImageAsParentRotated(
531                         session, direction, session->TrackColours[SCHEME_TRACK] | 28408, 0, 0, 16, 32, 1, height + 24);
532                     break;
533                 case 2:
534                     PaintAddImageAsParentRotated(
535                         session, direction, session->TrackColours[SCHEME_TRACK] | 28413, 0, 0, 16, 32, 1, height + 24);
536                     break;
537                 case 3:
538                     PaintAddImageAsParentRotated(
539                         session, direction, session->TrackColours[SCHEME_TRACK] | 28398, 16, 0, 16, 32, 1, height + 24);
540                     break;
541             }
542             paint_util_set_segment_support_height(
543                 session,
544                 paint_util_rotate_segments(
545                     SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction),
546                 0xFFFF, 0);
547             paint_util_set_general_support_height(session, height + 48, 0x20);
548             break;
549         case 6:
550             switch (direction)
551             {
552                 case 0:
553                     PaintAddImageAsParentRotated(
554                         session, direction, session->TrackColours[SCHEME_TRACK] | 28402, 6, 0, 20, 32, 1, height + 24);
555                     break;
556                 case 1:
557                     PaintAddImageAsParentRotated(
558                         session, direction, session->TrackColours[SCHEME_TRACK] | 28407, 6, 0, 20, 32, 1, height + 24);
559                     break;
560                 case 2:
561                     PaintAddImageAsParentRotated(
562                         session, direction, session->TrackColours[SCHEME_TRACK] | 28412, 6, 0, 20, 32, 1, height + 24);
563                     break;
564                 case 3:
565                     PaintAddImageAsParentRotated(
566                         session, direction, session->TrackColours[SCHEME_TRACK] | 28397, 6, 0, 20, 32, 1, height + 24);
567                     break;
568             }
569 
570             paint_util_set_segment_support_height(
571                 session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction),
572                 0xFFFF, 0);
573             switch (direction)
574             {
575                 case 0:
576                 case 2:
577                     metal_a_supports_paint_setup(
578                         session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
579                     break;
580                 case 1:
581                 case 3:
582                     metal_a_supports_paint_setup(
583                         session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
584                     break;
585             }
586 
587             switch (direction)
588             {
589                 case 2:
590                     paint_util_push_tunnel_right(session, height, TUNNEL_0);
591                     break;
592                 case 3:
593                     paint_util_push_tunnel_left(session, height, TUNNEL_0);
594                     break;
595             }
596             paint_util_set_general_support_height(session, height + 48, 0x20);
597             break;
598     }
599 }
600 
601 /** rct2: 0x008AFF1C */
mini_suspended_rc_track_right_quarter_turn_5(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)602 static void mini_suspended_rc_track_right_quarter_turn_5(
603     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
604     const TrackElement& trackElement)
605 {
606     trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence];
607     mini_suspended_rc_track_left_quarter_turn_5(session, ride, trackSequence, (direction - 1) & 3, height, trackElement);
608 }
609 
610 /** rct2: 0x008AFF2C */
mini_suspended_rc_track_s_bend_left(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)611 static void mini_suspended_rc_track_s_bend_left(
612     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
613     const TrackElement& trackElement)
614 {
615     switch (trackSequence)
616     {
617         case 0:
618             switch (direction)
619             {
620                 case 0:
621                     PaintAddImageAsParentRotated(
622                         session, direction, session->TrackColours[SCHEME_TRACK] | 28421, 0, 6, 32, 20, 1, height + 24);
623                     break;
624                 case 1:
625                     PaintAddImageAsParentRotated(
626                         session, direction, session->TrackColours[SCHEME_TRACK] | 28428, 0, 6, 32, 20, 1, height + 24);
627                     break;
628                 case 2:
629                     PaintAddImageAsParentRotated(
630                         session, direction, session->TrackColours[SCHEME_TRACK] | 28424, 0, 6, 32, 20, 1, height + 24);
631                     break;
632                 case 3:
633                     PaintAddImageAsParentRotated(
634                         session, direction, session->TrackColours[SCHEME_TRACK] | 28425, 0, 6, 32, 20, 1, height + 24);
635                     break;
636             }
637 
638             paint_util_set_segment_support_height(
639                 session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
640             switch (direction)
641             {
642                 case 0:
643                 case 2:
644                     metal_a_supports_paint_setup(
645                         session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
646                     break;
647                 case 1:
648                 case 3:
649                     metal_a_supports_paint_setup(
650                         session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
651                     break;
652             }
653 
654             if (direction == 0 || direction == 3)
655             {
656                 paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0);
657             }
658             paint_util_set_general_support_height(session, height + 48, 0x20);
659             break;
660         case 1:
661             switch (direction)
662             {
663                 case 0:
664                     PaintAddImageAsParentRotated(
665                         session, direction, session->TrackColours[SCHEME_TRACK] | 28422, 0, 0, 32, 26, 1, height + 24);
666                     break;
667                 case 1:
668                     PaintAddImageAsParentRotated(
669                         session, direction, session->TrackColours[SCHEME_TRACK] | 28427, 0, 0, 32, 26, 1, height + 24);
670                     break;
671                 case 2:
672                     PaintAddImageAsParentRotated(
673                         session, direction, session->TrackColours[SCHEME_TRACK] | 28423, 0, 6, 32, 26, 1, height + 24);
674                     break;
675                 case 3:
676                     PaintAddImageAsParentRotated(
677                         session, direction, session->TrackColours[SCHEME_TRACK] | 28426, 0, 6, 32, 26, 1, height + 24);
678                     break;
679             }
680 
681             paint_util_set_segment_support_height(
682                 session,
683                 paint_util_rotate_segments(
684                     SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
685                 0xFFFF, 0);
686             switch (direction)
687             {
688                 case 0:
689                     metal_a_supports_paint_setup(
690                         session, METAL_SUPPORTS_FORK, 5, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
691                     break;
692                 case 1:
693                     metal_a_supports_paint_setup(
694                         session, METAL_SUPPORTS_FORK_ALT, 6, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
695                     break;
696             }
697 
698             paint_util_set_general_support_height(session, height + 48, 0x20);
699             break;
700         case 2:
701             switch (direction)
702             {
703                 case 0:
704                     PaintAddImageAsParentRotated(
705                         session, direction, session->TrackColours[SCHEME_TRACK] | 28423, 0, 6, 32, 26, 1, height + 24);
706                     break;
707                 case 1:
708                     PaintAddImageAsParentRotated(
709                         session, direction, session->TrackColours[SCHEME_TRACK] | 28426, 0, 6, 32, 26, 1, height + 24);
710                     break;
711                 case 2:
712                     PaintAddImageAsParentRotated(
713                         session, direction, session->TrackColours[SCHEME_TRACK] | 28422, 0, 0, 32, 26, 1, height + 24);
714                     break;
715                 case 3:
716                     PaintAddImageAsParentRotated(
717                         session, direction, session->TrackColours[SCHEME_TRACK] | 28427, 0, 0, 32, 26, 1, height + 24);
718                     break;
719             }
720 
721             paint_util_set_segment_support_height(
722                 session,
723                 paint_util_rotate_segments(
724                     SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
725                 0xFFFF, 0);
726             switch (direction)
727             {
728                 case 2:
729                     metal_a_supports_paint_setup(
730                         session, METAL_SUPPORTS_FORK, 5, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
731                     break;
732                 case 3:
733                     metal_a_supports_paint_setup(
734                         session, METAL_SUPPORTS_FORK_ALT, 6, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
735                     break;
736             }
737 
738             paint_util_set_general_support_height(session, height + 48, 0x20);
739             break;
740         case 3:
741             switch (direction)
742             {
743                 case 0:
744                     PaintAddImageAsParentRotated(
745                         session, direction, session->TrackColours[SCHEME_TRACK] | 28424, 0, 6, 32, 20, 1, height + 24);
746                     break;
747                 case 1:
748                     PaintAddImageAsParentRotated(
749                         session, direction, session->TrackColours[SCHEME_TRACK] | 28425, 0, 6, 32, 20, 1, height + 24);
750                     break;
751                 case 2:
752                     PaintAddImageAsParentRotated(
753                         session, direction, session->TrackColours[SCHEME_TRACK] | 28421, 0, 6, 32, 20, 1, height + 24);
754                     break;
755                 case 3:
756                     PaintAddImageAsParentRotated(
757                         session, direction, session->TrackColours[SCHEME_TRACK] | 28428, 0, 6, 32, 20, 1, height + 24);
758                     break;
759             }
760 
761             paint_util_set_segment_support_height(
762                 session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
763             switch (direction)
764             {
765                 case 0:
766                 case 2:
767                     metal_a_supports_paint_setup(
768                         session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
769                     break;
770                 case 1:
771                 case 3:
772                     metal_a_supports_paint_setup(
773                         session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
774                     break;
775             }
776 
777             switch (direction)
778             {
779                 case 1:
780                     paint_util_push_tunnel_right(session, height, TUNNEL_0);
781                     break;
782                 case 2:
783                     paint_util_push_tunnel_left(session, height, TUNNEL_0);
784                     break;
785             }
786             paint_util_set_general_support_height(session, height + 48, 0x20);
787             break;
788     }
789 }
790 
791 /** rct2: 0x008AFF3C */
mini_suspended_rc_track_s_bend_right(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)792 static void mini_suspended_rc_track_s_bend_right(
793     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
794     const TrackElement& trackElement)
795 {
796     switch (trackSequence)
797     {
798         case 0:
799             switch (direction)
800             {
801                 case 0:
802                     PaintAddImageAsParentRotated(
803                         session, direction, session->TrackColours[SCHEME_TRACK] | 28417, 0, 6, 32, 20, 1, height + 24);
804                     break;
805                 case 1:
806                     PaintAddImageAsParentRotated(
807                         session, direction, session->TrackColours[SCHEME_TRACK] | 28432, 0, 6, 32, 20, 1, height + 24);
808                     break;
809                 case 2:
810                     PaintAddImageAsParentRotated(
811                         session, direction, session->TrackColours[SCHEME_TRACK] | 28420, 0, 6, 32, 20, 1, height + 24);
812                     break;
813                 case 3:
814                     PaintAddImageAsParentRotated(
815                         session, direction, session->TrackColours[SCHEME_TRACK] | 28429, 0, 6, 32, 20, 1, height + 24);
816                     break;
817             }
818 
819             paint_util_set_segment_support_height(
820                 session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
821             switch (direction)
822             {
823                 case 0:
824                 case 2:
825                     metal_a_supports_paint_setup(
826                         session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
827                     break;
828                 case 1:
829                 case 3:
830                     metal_a_supports_paint_setup(
831                         session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
832                     break;
833             }
834 
835             if (direction == 0 || direction == 3)
836             {
837                 paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0);
838             }
839             paint_util_set_general_support_height(session, height + 48, 0x20);
840             break;
841         case 1:
842             switch (direction)
843             {
844                 case 0:
845                     PaintAddImageAsParentRotated(
846                         session, direction, session->TrackColours[SCHEME_TRACK] | 28418, 0, 6, 32, 26, 1, height + 24);
847                     break;
848                 case 1:
849                     PaintAddImageAsParentRotated(
850                         session, direction, session->TrackColours[SCHEME_TRACK] | 28431, 0, 6, 32, 26, 1, height + 24);
851                     break;
852                 case 2:
853                     PaintAddImageAsParentRotated(
854                         session, direction, session->TrackColours[SCHEME_TRACK] | 28419, 0, 0, 32, 26, 1, height + 24);
855                     break;
856                 case 3:
857                     PaintAddImageAsParentRotated(
858                         session, direction, session->TrackColours[SCHEME_TRACK] | 28430, 0, 0, 32, 26, 1, height + 24);
859                     break;
860             }
861 
862             paint_util_set_segment_support_height(
863                 session,
864                 paint_util_rotate_segments(
865                     SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
866                 0xFFFF, 0);
867             switch (direction)
868             {
869                 case 0:
870                     metal_a_supports_paint_setup(
871                         session, METAL_SUPPORTS_FORK, 8, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
872                     break;
873                 case 1:
874                     metal_a_supports_paint_setup(
875                         session, METAL_SUPPORTS_FORK_ALT, 7, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
876                     break;
877             }
878 
879             paint_util_set_general_support_height(session, height + 48, 0x20);
880             break;
881         case 2:
882             switch (direction)
883             {
884                 case 0:
885                     PaintAddImageAsParentRotated(
886                         session, direction, session->TrackColours[SCHEME_TRACK] | 28419, 0, 0, 32, 26, 1, height + 24);
887                     break;
888                 case 1:
889                     PaintAddImageAsParentRotated(
890                         session, direction, session->TrackColours[SCHEME_TRACK] | 28430, 0, 0, 32, 26, 1, height + 24);
891                     break;
892                 case 2:
893                     PaintAddImageAsParentRotated(
894                         session, direction, session->TrackColours[SCHEME_TRACK] | 28418, 0, 6, 32, 26, 1, height + 24);
895                     break;
896                 case 3:
897                     PaintAddImageAsParentRotated(
898                         session, direction, session->TrackColours[SCHEME_TRACK] | 28431, 0, 6, 32, 26, 1, height + 24);
899                     break;
900             }
901 
902             paint_util_set_segment_support_height(
903                 session,
904                 paint_util_rotate_segments(
905                     SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
906                 0xFFFF, 0);
907             switch (direction)
908             {
909                 case 2:
910                     metal_a_supports_paint_setup(
911                         session, METAL_SUPPORTS_FORK, 8, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
912                     break;
913                 case 3:
914                     metal_a_supports_paint_setup(
915                         session, METAL_SUPPORTS_FORK_ALT, 7, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
916                     break;
917             }
918 
919             paint_util_set_general_support_height(session, height + 48, 0x20);
920             break;
921         case 3:
922             switch (direction)
923             {
924                 case 0:
925                     PaintAddImageAsParentRotated(
926                         session, direction, session->TrackColours[SCHEME_TRACK] | 28420, 0, 6, 32, 20, 1, height + 24);
927                     break;
928                 case 1:
929                     PaintAddImageAsParentRotated(
930                         session, direction, session->TrackColours[SCHEME_TRACK] | 28429, 0, 6, 32, 20, 1, height + 24);
931                     break;
932                 case 2:
933                     PaintAddImageAsParentRotated(
934                         session, direction, session->TrackColours[SCHEME_TRACK] | 28417, 0, 6, 32, 20, 1, height + 24);
935                     break;
936                 case 3:
937                     PaintAddImageAsParentRotated(
938                         session, direction, session->TrackColours[SCHEME_TRACK] | 28432, 0, 6, 32, 20, 1, height + 24);
939                     break;
940             }
941 
942             paint_util_set_segment_support_height(
943                 session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
944             switch (direction)
945             {
946                 case 0:
947                 case 2:
948                     metal_a_supports_paint_setup(
949                         session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
950                     break;
951                 case 1:
952                 case 3:
953                     metal_a_supports_paint_setup(
954                         session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
955                     break;
956             }
957 
958             switch (direction)
959             {
960                 case 1:
961                     paint_util_push_tunnel_right(session, height, TUNNEL_0);
962                     break;
963                 case 2:
964                     paint_util_push_tunnel_left(session, height, TUNNEL_0);
965                     break;
966             }
967             paint_util_set_general_support_height(session, height + 48, 0x20);
968             break;
969     }
970 }
971 
972 /** rct2: 0x008AFF7C */
mini_suspended_rc_track_left_quarter_turn_3(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)973 static void mini_suspended_rc_track_left_quarter_turn_3(
974     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
975     const TrackElement& trackElement)
976 {
977     switch (trackSequence)
978     {
979         case 0:
980             switch (direction)
981             {
982                 case 0:
983                     PaintAddImageAsParentRotated(
984                         session, direction, session->TrackColours[SCHEME_TRACK] | 28452, 0, 6, 32, 20, 3, height + 24);
985                     break;
986                 case 1:
987                     PaintAddImageAsParentRotated(
988                         session, direction, session->TrackColours[SCHEME_TRACK] | 28455, 0, 6, 32, 20, 3, height + 24);
989                     break;
990                 case 2:
991                     PaintAddImageAsParentRotated(
992                         session, direction, session->TrackColours[SCHEME_TRACK] | 28458, 0, 6, 32, 20, 3, height + 24);
993                     break;
994                 case 3:
995                     PaintAddImageAsParentRotated(
996                         session, direction, session->TrackColours[SCHEME_TRACK] | 28449, 0, 6, 32, 20, 3, height + 24);
997                     break;
998             }
999 
1000             paint_util_set_segment_support_height(
1001                 session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
1002                 0xFFFF, 0);
1003             switch (direction)
1004             {
1005                 case 0:
1006                 case 2:
1007                     metal_a_supports_paint_setup(
1008                         session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1009                     break;
1010                 case 1:
1011                 case 3:
1012                     metal_a_supports_paint_setup(
1013                         session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1014                     break;
1015             }
1016 
1017             if (direction == 0 || direction == 3)
1018             {
1019                 paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0);
1020             }
1021             paint_util_set_general_support_height(session, height + 32, 0x20);
1022             break;
1023         case 1:
1024             paint_util_set_general_support_height(session, height + 32, 0x20);
1025             break;
1026         case 2:
1027             switch (direction)
1028             {
1029                 case 0:
1030                     PaintAddImageAsParentRotated(
1031                         session, direction, session->TrackColours[SCHEME_TRACK] | 28451, 16, 0, 16, 16, 3, height + 24);
1032                     break;
1033                 case 1:
1034                     PaintAddImageAsParentRotated(
1035                         session, direction, session->TrackColours[SCHEME_TRACK] | 28454, 0, 0, 16, 16, 3, height + 24);
1036                     break;
1037                 case 2:
1038                     PaintAddImageAsParentRotated(
1039                         session, direction, session->TrackColours[SCHEME_TRACK] | 28457, 0, 16, 16, 16, 3, height + 24);
1040                     break;
1041                 case 3:
1042                     PaintAddImageAsParentRotated(
1043                         session, direction, session->TrackColours[SCHEME_TRACK] | 28448, 16, 16, 16, 16, 3, height + 24);
1044                     break;
1045             }
1046             paint_util_set_segment_support_height(
1047                 session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
1048             paint_util_set_general_support_height(session, height + 32, 0x20);
1049             break;
1050         case 3:
1051             switch (direction)
1052             {
1053                 case 0:
1054                     PaintAddImageAsParentRotated(
1055                         session, direction, session->TrackColours[SCHEME_TRACK] | 28450, 6, 0, 20, 32, 3, height + 24);
1056                     break;
1057                 case 1:
1058                     PaintAddImageAsParentRotated(
1059                         session, direction, session->TrackColours[SCHEME_TRACK] | 28453, 6, 0, 20, 32, 3, height + 24);
1060                     break;
1061                 case 2:
1062                     PaintAddImageAsParentRotated(
1063                         session, direction, session->TrackColours[SCHEME_TRACK] | 28456, 6, 0, 20, 32, 3, height + 24);
1064                     break;
1065                 case 3:
1066                     PaintAddImageAsParentRotated(
1067                         session, direction, session->TrackColours[SCHEME_TRACK] | 28447, 6, 0, 20, 32, 3, height + 24);
1068                     break;
1069             }
1070 
1071             paint_util_set_segment_support_height(
1072                 session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction),
1073                 0xFFFF, 0);
1074             switch (direction)
1075             {
1076                 case 0:
1077                 case 2:
1078                     metal_a_supports_paint_setup(
1079                         session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1080                     break;
1081                 case 1:
1082                 case 3:
1083                     metal_a_supports_paint_setup(
1084                         session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1085                     break;
1086             }
1087 
1088             switch (direction)
1089             {
1090                 case 2:
1091                     paint_util_push_tunnel_right(session, height, TUNNEL_0);
1092                     break;
1093                 case 3:
1094                     paint_util_push_tunnel_left(session, height, TUNNEL_0);
1095                     break;
1096             }
1097             paint_util_set_general_support_height(session, height + 32, 0x20);
1098             break;
1099     }
1100 }
1101 
1102 /** rct2: 0x008AFF8C */
mini_suspended_rc_track_right_quarter_turn_3(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)1103 static void mini_suspended_rc_track_right_quarter_turn_3(
1104     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
1105     const TrackElement& trackElement)
1106 {
1107     trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence];
1108     mini_suspended_rc_track_left_quarter_turn_3(session, ride, trackSequence, (direction - 1) & 3, height, trackElement);
1109 }
1110 
1111 /** rct2: 0x008AFFAC */
mini_suspended_rc_track_left_eighth_to_diag(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)1112 static void mini_suspended_rc_track_left_eighth_to_diag(
1113     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
1114     const TrackElement& trackElement)
1115 {
1116     switch (trackSequence)
1117     {
1118         case 0:
1119             switch (direction)
1120             {
1121                 case 0:
1122                     PaintAddImageAsParentRotated(
1123                         session, direction, session->TrackColours[SCHEME_TRACK] | 28475, 0, 0, 32, 20, 1, height + 24, 0, 6,
1124                         height + 24);
1125                     break;
1126                 case 1:
1127                     PaintAddImageAsParentRotated(
1128                         session, direction, session->TrackColours[SCHEME_TRACK] | 28479, 0, 0, 32, 20, 1, height + 24, 0, 6,
1129                         height + 24);
1130                     break;
1131                 case 2:
1132                     PaintAddImageAsParentRotated(
1133                         session, direction, session->TrackColours[SCHEME_TRACK] | 28483, 0, 0, 32, 20, 1, height + 24, 0, 6,
1134                         height + 24);
1135                     break;
1136                 case 3:
1137                     PaintAddImageAsParentRotated(
1138                         session, direction, session->TrackColours[SCHEME_TRACK] | 28487, 0, 0, 32, 20, 1, height + 24, 0, 6,
1139                         height + 24);
1140                     break;
1141             }
1142 
1143             paint_util_set_segment_support_height(
1144                 session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
1145             switch (direction)
1146             {
1147                 case 0:
1148                 case 2:
1149                     metal_a_supports_paint_setup(
1150                         session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1151                     break;
1152                 case 1:
1153                 case 3:
1154                     metal_a_supports_paint_setup(
1155                         session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1156                     break;
1157             }
1158 
1159             if (direction == 0 || direction == 3)
1160             {
1161                 paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0);
1162             }
1163             paint_util_set_general_support_height(session, height + 48, 0x20);
1164             break;
1165         case 1:
1166             switch (direction)
1167             {
1168                 case 0:
1169                     PaintAddImageAsParentRotated(
1170                         session, direction, session->TrackColours[SCHEME_TRACK] | 28476, 0, 0, 32, 16, 1, height + 24, 0, 0,
1171                         height + 24);
1172                     break;
1173                 case 1:
1174                     PaintAddImageAsParentRotated(
1175                         session, direction, session->TrackColours[SCHEME_TRACK] | 28480, 0, 0, 34, 16, 1, height + 24, 0, 0,
1176                         height + 24);
1177                     break;
1178                 case 2:
1179                     PaintAddImageAsParentRotated(
1180                         session, direction, session->TrackColours[SCHEME_TRACK] | 28484, 0, 0, 32, 16, 1, height + 24, 0, 16,
1181                         height + 24);
1182                     break;
1183                 case 3:
1184                     PaintAddImageAsParentRotated(
1185                         session, direction, session->TrackColours[SCHEME_TRACK] | 28488, 0, 0, 32, 16, 1, height + 24, 0, 16,
1186                         height + 24);
1187                     break;
1188             }
1189             paint_util_set_segment_support_height(
1190                 session,
1191                 paint_util_rotate_segments(
1192                     SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction),
1193                 0xFFFF, 0);
1194             paint_util_set_general_support_height(session, height + 48, 0x20);
1195             break;
1196         case 2:
1197             switch (direction)
1198             {
1199                 case 0:
1200                     PaintAddImageAsParentRotated(
1201                         session, direction, session->TrackColours[SCHEME_TRACK] | 28477, 0, 0, 16, 16, 1, height + 24, 0, 16,
1202                         height + 24);
1203                     break;
1204                 case 1:
1205                     PaintAddImageAsParentRotated(
1206                         session, direction, session->TrackColours[SCHEME_TRACK] | 28481, 0, 0, 16, 16, 1, height + 24, 16, 16,
1207                         height + 24);
1208                     break;
1209                 case 2:
1210                     PaintAddImageAsParentRotated(
1211                         session, direction, session->TrackColours[SCHEME_TRACK] | 28485, 0, 0, 16, 16, 1, height + 24, 16, 0,
1212                         height + 24);
1213                     break;
1214                 case 3:
1215                     PaintAddImageAsParentRotated(
1216                         session, direction, session->TrackColours[SCHEME_TRACK] | 28489, 0, 0, 16, 16, 1, height + 24, 0, 0,
1217                         height + 24);
1218                     break;
1219             }
1220             paint_util_set_segment_support_height(
1221                 session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction),
1222                 0xFFFF, 0);
1223             paint_util_set_general_support_height(session, height + 48, 0x20);
1224             break;
1225         case 3:
1226             paint_util_set_segment_support_height(
1227                 session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
1228             paint_util_set_general_support_height(session, height + 48, 0x20);
1229             break;
1230         case 4:
1231             switch (direction)
1232             {
1233                 case 0:
1234                     PaintAddImageAsParentRotated(
1235                         session, direction, session->TrackColours[SCHEME_TRACK] | 28478, 0, 0, 16, 16, 1, height + 24, 16, 16,
1236                         height + 24);
1237                     break;
1238                 case 1:
1239                     PaintAddImageAsParentRotated(
1240                         session, direction, session->TrackColours[SCHEME_TRACK] | 28482, 0, 0, 16, 18, 1, height + 24, 0, 16,
1241                         height + 24);
1242                     break;
1243                 case 2:
1244                     PaintAddImageAsParentRotated(
1245                         session, direction, session->TrackColours[SCHEME_TRACK] | 28486, 0, 0, 16, 16, 1, height + 24, 0, 0,
1246                         height + 24);
1247                     break;
1248                 case 3:
1249                     PaintAddImageAsParentRotated(
1250                         session, direction, session->TrackColours[SCHEME_TRACK] | 28490, 0, 0, 16, 16, 1, height + 24, 16, 0,
1251                         height + 24);
1252                     break;
1253             }
1254 
1255             paint_util_set_segment_support_height(
1256                 session,
1257                 paint_util_rotate_segments(
1258                     SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
1259                 0xFFFF, 0);
1260             switch (direction)
1261             {
1262                 case 0:
1263                     metal_a_supports_paint_setup(
1264                         session, METAL_SUPPORTS_FORK, 3, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1265                     break;
1266                 case 1:
1267                     metal_a_supports_paint_setup(
1268                         session, METAL_SUPPORTS_FORK_ALT, 1, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1269                     break;
1270                 case 2:
1271                     metal_a_supports_paint_setup(
1272                         session, METAL_SUPPORTS_FORK, 0, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1273                     break;
1274                 case 3:
1275                     metal_a_supports_paint_setup(
1276                         session, METAL_SUPPORTS_FORK_ALT, 2, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1277                     break;
1278             }
1279 
1280             paint_util_set_general_support_height(session, height + 48, 0x20);
1281             break;
1282     }
1283 }
1284 
1285 /** rct2: 0x008AFFBC */
mini_suspended_rc_track_right_eighth_to_diag(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)1286 static void mini_suspended_rc_track_right_eighth_to_diag(
1287     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
1288     const TrackElement& trackElement)
1289 {
1290     switch (trackSequence)
1291     {
1292         case 0:
1293             switch (direction)
1294             {
1295                 case 0:
1296                     PaintAddImageAsParentRotated(
1297                         session, direction, session->TrackColours[SCHEME_TRACK] | 28459, 0, 0, 32, 20, 1, height + 24, 0, 6,
1298                         height + 24);
1299                     break;
1300                 case 1:
1301                     PaintAddImageAsParentRotated(
1302                         session, direction, session->TrackColours[SCHEME_TRACK] | 28463, 0, 0, 32, 20, 1, height + 24, 0, 6,
1303                         height + 24);
1304                     break;
1305                 case 2:
1306                     PaintAddImageAsParentRotated(
1307                         session, direction, session->TrackColours[SCHEME_TRACK] | 28467, 0, 0, 32, 20, 1, height + 24, 0, 6,
1308                         height + 24);
1309                     break;
1310                 case 3:
1311                     PaintAddImageAsParentRotated(
1312                         session, direction, session->TrackColours[SCHEME_TRACK] | 28471, 0, 0, 32, 20, 1, height + 24, 0, 6,
1313                         height + 24);
1314                     break;
1315             }
1316 
1317             paint_util_set_segment_support_height(
1318                 session, paint_util_rotate_segments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0);
1319             switch (direction)
1320             {
1321                 case 0:
1322                 case 2:
1323                     metal_a_supports_paint_setup(
1324                         session, METAL_SUPPORTS_FORK, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1325                     break;
1326                 case 1:
1327                 case 3:
1328                     metal_a_supports_paint_setup(
1329                         session, METAL_SUPPORTS_FORK_ALT, 4, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1330                     break;
1331             }
1332 
1333             if (direction == 0 || direction == 3)
1334             {
1335                 paint_util_push_tunnel_rotated(session, direction, height, TUNNEL_0);
1336             }
1337             paint_util_set_general_support_height(session, height + 48, 0x20);
1338             break;
1339         case 1:
1340             switch (direction)
1341             {
1342                 case 0:
1343                     PaintAddImageAsParentRotated(
1344                         session, direction, session->TrackColours[SCHEME_TRACK] | 28460, 0, 0, 32, 16, 1, height + 24, 0, 16,
1345                         height + 24);
1346                     break;
1347                 case 1:
1348                     PaintAddImageAsParentRotated(
1349                         session, direction, session->TrackColours[SCHEME_TRACK] | 28464, 0, 0, 32, 16, 1, height + 24, 0, 16,
1350                         height + 24);
1351                     break;
1352                 case 2:
1353                     PaintAddImageAsParentRotated(
1354                         session, direction, session->TrackColours[SCHEME_TRACK] | 28468, 0, 0, 34, 16, 1, height + 24, 0, 0,
1355                         height + 24);
1356                     break;
1357                 case 3:
1358                     PaintAddImageAsParentRotated(
1359                         session, direction, session->TrackColours[SCHEME_TRACK] | 28472, 0, 0, 32, 16, 1, height + 24, 0, 0,
1360                         height + 24);
1361                     break;
1362             }
1363             paint_util_set_segment_support_height(
1364                 session,
1365                 paint_util_rotate_segments(
1366                     SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
1367                 0xFFFF, 0);
1368             paint_util_set_general_support_height(session, height + 48, 0x20);
1369             break;
1370         case 2:
1371             switch (direction)
1372             {
1373                 case 0:
1374                     PaintAddImageAsParentRotated(
1375                         session, direction, session->TrackColours[SCHEME_TRACK] | 28461, 0, 0, 16, 16, 1, height + 24, 0, 0,
1376                         height + 24);
1377                     break;
1378                 case 1:
1379                     PaintAddImageAsParentRotated(
1380                         session, direction, session->TrackColours[SCHEME_TRACK] | 28465, 0, 0, 16, 16, 1, height + 24, 16, 0,
1381                         height + 24);
1382                     break;
1383                 case 2:
1384                     PaintAddImageAsParentRotated(
1385                         session, direction, session->TrackColours[SCHEME_TRACK] | 28469, 0, 0, 28, 28, 1, height + 24, 4, 2,
1386                         height + 24);
1387                     break;
1388                 case 3:
1389                     PaintAddImageAsParentRotated(
1390                         session, direction, session->TrackColours[SCHEME_TRACK] | 28473, 0, 0, 16, 16, 1, height + 24, 0, 16,
1391                         height + 24);
1392                     break;
1393             }
1394             paint_util_set_segment_support_height(
1395                 session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction),
1396                 0xFFFF, 0);
1397             paint_util_set_general_support_height(session, height + 48, 0x20);
1398             break;
1399         case 3:
1400             paint_util_set_segment_support_height(
1401                 session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
1402             paint_util_set_general_support_height(session, height + 48, 0x20);
1403             break;
1404         case 4:
1405             switch (direction)
1406             {
1407                 case 0:
1408                     PaintAddImageAsParentRotated(
1409                         session, direction, session->TrackColours[SCHEME_TRACK] | 28462, 0, 0, 16, 16, 1, height + 24, 16, 0,
1410                         height + 24);
1411                     break;
1412                 case 1:
1413                     PaintAddImageAsParentRotated(
1414                         session, direction, session->TrackColours[SCHEME_TRACK] | 28466, 0, 0, 16, 16, 1, height + 24, 0, 0,
1415                         height + 24);
1416                     break;
1417                 case 2:
1418                     PaintAddImageAsParentRotated(
1419                         session, direction, session->TrackColours[SCHEME_TRACK] | 28470, 0, 0, 16, 18, 1, height + 24, 0, 16,
1420                         height + 24);
1421                     break;
1422                 case 3:
1423                     PaintAddImageAsParentRotated(
1424                         session, direction, session->TrackColours[SCHEME_TRACK] | 28474, 0, 0, 16, 16, 1, height + 24, 16, 16,
1425                         height + 24);
1426                     break;
1427             }
1428 
1429             paint_util_set_segment_support_height(
1430                 session,
1431                 paint_util_rotate_segments(
1432                     SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction),
1433                 0xFFFF, 0);
1434             switch (direction)
1435             {
1436                 case 0:
1437                     metal_a_supports_paint_setup(
1438                         session, METAL_SUPPORTS_FORK, 1, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1439                     break;
1440                 case 1:
1441                     metal_a_supports_paint_setup(
1442                         session, METAL_SUPPORTS_FORK_ALT, 0, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1443                     break;
1444                 case 2:
1445                     metal_a_supports_paint_setup(
1446                         session, METAL_SUPPORTS_FORK, 2, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1447                     break;
1448                 case 3:
1449                     metal_a_supports_paint_setup(
1450                         session, METAL_SUPPORTS_FORK_ALT, 3, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1451                     break;
1452             }
1453 
1454             paint_util_set_general_support_height(session, height + 48, 0x20);
1455             break;
1456     }
1457 }
1458 
1459 /** rct2: 0x008AFFCC */
mini_suspended_rc_track_left_eighth_to_orthogonal(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)1460 static void mini_suspended_rc_track_left_eighth_to_orthogonal(
1461     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
1462     const TrackElement& trackElement)
1463 {
1464     trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence];
1465     mini_suspended_rc_track_right_eighth_to_diag(session, ride, trackSequence, (direction + 2) & 3, height, trackElement);
1466 }
1467 
1468 /** rct2: 0x008AFFDC */
mini_suspended_rc_track_right_eighth_to_orthogonal(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)1469 static void mini_suspended_rc_track_right_eighth_to_orthogonal(
1470     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
1471     const TrackElement& trackElement)
1472 {
1473     trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence];
1474     mini_suspended_rc_track_left_eighth_to_diag(session, ride, trackSequence, (direction + 3) & 3, height, trackElement);
1475 }
1476 
1477 /** rct2: 0x008AFF9C */
mini_suspended_rc_track_diag_flat(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)1478 static void mini_suspended_rc_track_diag_flat(
1479     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
1480     const TrackElement& trackElement)
1481 {
1482     switch (trackSequence)
1483     {
1484         case 0:
1485             if (trackElement.HasChain())
1486             {
1487                 switch (direction)
1488                 {
1489                     case 3:
1490                         PaintAddImageAsParentRotated(
1491                             session, direction, session->TrackColours[SCHEME_TRACK] | 28510, -16, -16, 32, 32, 1, height + 24,
1492                             -16, -16, height + 24);
1493                         break;
1494                 }
1495             }
1496             else
1497             {
1498                 switch (direction)
1499                 {
1500                     case 3:
1501                         PaintAddImageAsParentRotated(
1502                             session, direction, session->TrackColours[SCHEME_TRACK] | 28494, -16, -16, 32, 32, 1, height + 24,
1503                             -16, -16, height + 24);
1504                         break;
1505                 }
1506             }
1507             paint_util_set_segment_support_height(
1508                 session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
1509             paint_util_set_general_support_height(session, height + 48, 0x20);
1510             break;
1511         case 1:
1512             if (trackElement.HasChain())
1513             {
1514                 switch (direction)
1515                 {
1516                     case 0:
1517                         PaintAddImageAsParentRotated(
1518                             session, direction, session->TrackColours[SCHEME_TRACK] | 28507, -16, -16, 32, 32, 1, height + 24,
1519                             -16, -16, height + 24);
1520                         break;
1521                 }
1522             }
1523             else
1524             {
1525                 switch (direction)
1526                 {
1527                     case 0:
1528                         PaintAddImageAsParentRotated(
1529                             session, direction, session->TrackColours[SCHEME_TRACK] | 28491, -16, -16, 32, 32, 1, height + 24,
1530                             -16, -16, height + 24);
1531                         break;
1532                 }
1533             }
1534             paint_util_set_segment_support_height(
1535                 session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
1536             paint_util_set_general_support_height(session, height + 48, 0x20);
1537             break;
1538         case 2:
1539             if (trackElement.HasChain())
1540             {
1541                 switch (direction)
1542                 {
1543                     case 2:
1544                         PaintAddImageAsParentRotated(
1545                             session, direction, session->TrackColours[SCHEME_TRACK] | 28509, -16, -16, 32, 32, 1, height + 24,
1546                             -16, -16, height + 24);
1547                         break;
1548                 }
1549             }
1550             else
1551             {
1552                 switch (direction)
1553                 {
1554                     case 2:
1555                         PaintAddImageAsParentRotated(
1556                             session, direction, session->TrackColours[SCHEME_TRACK] | 28493, -16, -16, 32, 32, 1, height + 24,
1557                             -16, -16, height + 24);
1558                         break;
1559                 }
1560             }
1561             paint_util_set_segment_support_height(
1562                 session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
1563             paint_util_set_general_support_height(session, height + 48, 0x20);
1564             break;
1565         case 3:
1566             if (trackElement.HasChain())
1567             {
1568                 switch (direction)
1569                 {
1570                     case 1:
1571                         PaintAddImageAsParentRotated(
1572                             session, direction, session->TrackColours[SCHEME_TRACK] | 28508, -16, -16, 32, 32, 1, height + 24,
1573                             -16, -16, height + 24);
1574                         break;
1575                 }
1576             }
1577             else
1578             {
1579                 switch (direction)
1580                 {
1581                     case 1:
1582                         PaintAddImageAsParentRotated(
1583                             session, direction, session->TrackColours[SCHEME_TRACK] | 28492, -16, -16, 32, 32, 1, height + 24,
1584                             -16, -16, height + 24);
1585                         break;
1586                 }
1587             }
1588 
1589             paint_util_set_segment_support_height(
1590                 session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
1591             switch (direction)
1592             {
1593                 case 0:
1594                     metal_a_supports_paint_setup(
1595                         session, METAL_SUPPORTS_FORK, 1, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1596                     break;
1597                 case 1:
1598                     metal_a_supports_paint_setup(
1599                         session, METAL_SUPPORTS_FORK_ALT, 0, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1600                     break;
1601                 case 2:
1602                     metal_a_supports_paint_setup(
1603                         session, METAL_SUPPORTS_FORK, 2, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1604                     break;
1605                 case 3:
1606                     metal_a_supports_paint_setup(
1607                         session, METAL_SUPPORTS_FORK_ALT, 3, 0, height + 30, session->TrackColours[SCHEME_SUPPORTS]);
1608                     break;
1609             }
1610 
1611             paint_util_set_general_support_height(session, height + 48, 0x20);
1612             break;
1613     }
1614 }
1615 
1616 /** rct2: 0x008B000C */
mini_suspended_rc_track_diag_25_deg_up(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)1617 static void mini_suspended_rc_track_diag_25_deg_up(
1618     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
1619     const TrackElement& trackElement)
1620 {
1621     switch (trackSequence)
1622     {
1623         case 0:
1624             if (trackElement.HasChain())
1625             {
1626                 switch (direction)
1627                 {
1628                     case 3:
1629                         PaintAddImageAsParentRotated(
1630                             session, direction, session->TrackColours[SCHEME_TRACK] | 28522, -16, -16, 32, 32, 1, height + 24,
1631                             -16, -16, height + 40);
1632                         break;
1633                 }
1634             }
1635             else
1636             {
1637                 switch (direction)
1638                 {
1639                     case 3:
1640                         PaintAddImageAsParentRotated(
1641                             session, direction, session->TrackColours[SCHEME_TRACK] | 28506, -16, -16, 32, 32, 1, height + 24,
1642                             -16, -16, height + 40);
1643                         break;
1644                 }
1645             }
1646             paint_util_set_segment_support_height(
1647                 session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
1648             paint_util_set_general_support_height(session, height + 72, 0x20);
1649             break;
1650         case 1:
1651             if (trackElement.HasChain())
1652             {
1653                 switch (direction)
1654                 {
1655                     case 0:
1656                         PaintAddImageAsParentRotated(
1657                             session, direction, session->TrackColours[SCHEME_TRACK] | 28519, -16, -16, 32, 32, 1, height + 24,
1658                             -16, -16, height + 40);
1659                         break;
1660                 }
1661             }
1662             else
1663             {
1664                 switch (direction)
1665                 {
1666                     case 0:
1667                         PaintAddImageAsParentRotated(
1668                             session, direction, session->TrackColours[SCHEME_TRACK] | 28503, -16, -16, 32, 32, 1, height + 24,
1669                             -16, -16, height + 40);
1670                         break;
1671                 }
1672             }
1673             paint_util_set_segment_support_height(
1674                 session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
1675             paint_util_set_general_support_height(session, height + 72, 0x20);
1676             break;
1677         case 2:
1678             if (trackElement.HasChain())
1679             {
1680                 switch (direction)
1681                 {
1682                     case 2:
1683                         PaintAddImageAsParentRotated(
1684                             session, direction, session->TrackColours[SCHEME_TRACK] | 28521, -16, -16, 32, 32, 1, height + 24,
1685                             -16, -16, height + 40);
1686                         break;
1687                 }
1688             }
1689             else
1690             {
1691                 switch (direction)
1692                 {
1693                     case 2:
1694                         PaintAddImageAsParentRotated(
1695                             session, direction, session->TrackColours[SCHEME_TRACK] | 28505, -16, -16, 32, 32, 1, height + 24,
1696                             -16, -16, height + 40);
1697                         break;
1698                 }
1699             }
1700             paint_util_set_segment_support_height(
1701                 session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
1702             paint_util_set_general_support_height(session, height + 72, 0x20);
1703             break;
1704         case 3:
1705             if (trackElement.HasChain())
1706             {
1707                 switch (direction)
1708                 {
1709                     case 1:
1710                         PaintAddImageAsParentRotated(
1711                             session, direction, session->TrackColours[SCHEME_TRACK] | 28520, -16, -16, 32, 32, 1, height + 24,
1712                             -16, -16, height + 40);
1713                         break;
1714                 }
1715             }
1716             else
1717             {
1718                 switch (direction)
1719                 {
1720                     case 1:
1721                         PaintAddImageAsParentRotated(
1722                             session, direction, session->TrackColours[SCHEME_TRACK] | 28504, -16, -16, 32, 32, 1, height + 24,
1723                             -16, -16, height + 40);
1724                         break;
1725                 }
1726             }
1727 
1728             paint_util_set_segment_support_height(
1729                 session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
1730             switch (direction)
1731             {
1732                 case 0:
1733                     metal_a_supports_paint_setup(
1734                         session, METAL_SUPPORTS_FORK, 1, 0, height + 42, session->TrackColours[SCHEME_SUPPORTS]);
1735                     break;
1736                 case 1:
1737                     metal_a_supports_paint_setup(
1738                         session, METAL_SUPPORTS_FORK_ALT, 0, 0, height + 42, session->TrackColours[SCHEME_SUPPORTS]);
1739                     break;
1740                 case 2:
1741                     metal_a_supports_paint_setup(
1742                         session, METAL_SUPPORTS_FORK, 2, 0, height + 42, session->TrackColours[SCHEME_SUPPORTS]);
1743                     break;
1744                 case 3:
1745                     metal_a_supports_paint_setup(
1746                         session, METAL_SUPPORTS_FORK_ALT, 3, 0, height + 42, session->TrackColours[SCHEME_SUPPORTS]);
1747                     break;
1748             }
1749 
1750             paint_util_set_general_support_height(session, height + 72, 0x20);
1751             break;
1752     }
1753 }
1754 
1755 /** rct2: 0x008AFFEC */
mini_suspended_rc_track_diag_flat_to_25_deg_up(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)1756 static void mini_suspended_rc_track_diag_flat_to_25_deg_up(
1757     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
1758     const TrackElement& trackElement)
1759 {
1760     switch (trackSequence)
1761     {
1762         case 0:
1763             if (trackElement.HasChain())
1764             {
1765                 switch (direction)
1766                 {
1767                     case 3:
1768                         PaintAddImageAsParentRotated(
1769                             session, direction, session->TrackColours[SCHEME_TRACK] | 28514, -16, -16, 32, 32, 1, height + 24,
1770                             -16, -16, height + 32);
1771                         break;
1772                 }
1773             }
1774             else
1775             {
1776                 switch (direction)
1777                 {
1778                     case 3:
1779                         PaintAddImageAsParentRotated(
1780                             session, direction, session->TrackColours[SCHEME_TRACK] | 28498, -16, -16, 32, 32, 1, height + 24,
1781                             -16, -16, height + 32);
1782                         break;
1783                 }
1784             }
1785             paint_util_set_segment_support_height(
1786                 session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
1787             paint_util_set_general_support_height(session, height + 64, 0x20);
1788             break;
1789         case 1:
1790             if (trackElement.HasChain())
1791             {
1792                 switch (direction)
1793                 {
1794                     case 0:
1795                         PaintAddImageAsParentRotated(
1796                             session, direction, session->TrackColours[SCHEME_TRACK] | 28511, -16, -16, 32, 32, 1, height + 24,
1797                             -16, -16, height + 32);
1798                         break;
1799                 }
1800             }
1801             else
1802             {
1803                 switch (direction)
1804                 {
1805                     case 0:
1806                         PaintAddImageAsParentRotated(
1807                             session, direction, session->TrackColours[SCHEME_TRACK] | 28495, -16, -16, 32, 32, 1, height + 24,
1808                             -16, -16, height + 32);
1809                         break;
1810                 }
1811             }
1812             paint_util_set_segment_support_height(
1813                 session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
1814             paint_util_set_general_support_height(session, height + 64, 0x20);
1815             break;
1816         case 2:
1817             if (trackElement.HasChain())
1818             {
1819                 switch (direction)
1820                 {
1821                     case 2:
1822                         PaintAddImageAsParentRotated(
1823                             session, direction, session->TrackColours[SCHEME_TRACK] | 28513, -16, -16, 32, 32, 1, height + 24,
1824                             -16, -16, height + 32);
1825                         break;
1826                 }
1827             }
1828             else
1829             {
1830                 switch (direction)
1831                 {
1832                     case 2:
1833                         PaintAddImageAsParentRotated(
1834                             session, direction, session->TrackColours[SCHEME_TRACK] | 28497, -16, -16, 32, 32, 1, height + 24,
1835                             -16, -16, height + 32);
1836                         break;
1837                 }
1838             }
1839             paint_util_set_segment_support_height(
1840                 session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
1841             paint_util_set_general_support_height(session, height + 64, 0x20);
1842             break;
1843         case 3:
1844             if (trackElement.HasChain())
1845             {
1846                 switch (direction)
1847                 {
1848                     case 1:
1849                         PaintAddImageAsParentRotated(
1850                             session, direction, session->TrackColours[SCHEME_TRACK] | 28512, -16, -16, 32, 32, 1, height + 24,
1851                             -16, -16, height + 32);
1852                         break;
1853                 }
1854             }
1855             else
1856             {
1857                 switch (direction)
1858                 {
1859                     case 1:
1860                         PaintAddImageAsParentRotated(
1861                             session, direction, session->TrackColours[SCHEME_TRACK] | 28496, -16, -16, 32, 32, 1, height + 24,
1862                             -16, -16, height + 32);
1863                         break;
1864                 }
1865             }
1866 
1867             paint_util_set_segment_support_height(
1868                 session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
1869             switch (direction)
1870             {
1871                 case 0:
1872                     metal_a_supports_paint_setup(
1873                         session, METAL_SUPPORTS_FORK, 1, 0, height + 34, session->TrackColours[SCHEME_SUPPORTS]);
1874                     break;
1875                 case 1:
1876                     metal_a_supports_paint_setup(
1877                         session, METAL_SUPPORTS_FORK_ALT, 0, 0, height + 34, session->TrackColours[SCHEME_SUPPORTS]);
1878                     break;
1879                 case 2:
1880                     metal_a_supports_paint_setup(
1881                         session, METAL_SUPPORTS_FORK, 2, 0, height + 34, session->TrackColours[SCHEME_SUPPORTS]);
1882                     break;
1883                 case 3:
1884                     metal_a_supports_paint_setup(
1885                         session, METAL_SUPPORTS_FORK_ALT, 3, 0, height + 34, session->TrackColours[SCHEME_SUPPORTS]);
1886                     break;
1887             }
1888 
1889             paint_util_set_general_support_height(session, height + 64, 0x20);
1890             break;
1891     }
1892 }
1893 
1894 /** rct2: 0x008AFFFC */
mini_suspended_rc_track_diag_25_deg_up_to_flat(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)1895 static void mini_suspended_rc_track_diag_25_deg_up_to_flat(
1896     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
1897     const TrackElement& trackElement)
1898 {
1899     switch (trackSequence)
1900     {
1901         case 0:
1902             if (trackElement.HasChain())
1903             {
1904                 switch (direction)
1905                 {
1906                     case 3:
1907                         PaintAddImageAsParentRotated(
1908                             session, direction, session->TrackColours[SCHEME_TRACK] | 28518, -16, -16, 32, 32, 1, height + 24,
1909                             -16, -16, height + 32);
1910                         break;
1911                 }
1912             }
1913             else
1914             {
1915                 switch (direction)
1916                 {
1917                     case 3:
1918                         PaintAddImageAsParentRotated(
1919                             session, direction, session->TrackColours[SCHEME_TRACK] | 28502, -16, -16, 32, 32, 1, height + 24,
1920                             -16, -16, height + 32);
1921                         break;
1922                 }
1923             }
1924             paint_util_set_segment_support_height(
1925                 session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
1926             paint_util_set_general_support_height(session, height + 72, 0x20);
1927             break;
1928         case 1:
1929             if (trackElement.HasChain())
1930             {
1931                 switch (direction)
1932                 {
1933                     case 0:
1934                         PaintAddImageAsParentRotated(
1935                             session, direction, session->TrackColours[SCHEME_TRACK] | 28515, -16, -16, 32, 32, 1, height + 24,
1936                             -16, -16, height + 32);
1937                         break;
1938                 }
1939             }
1940             else
1941             {
1942                 switch (direction)
1943                 {
1944                     case 0:
1945                         PaintAddImageAsParentRotated(
1946                             session, direction, session->TrackColours[SCHEME_TRACK] | 28499, -16, -16, 32, 32, 1, height + 24,
1947                             -16, -16, height + 32);
1948                         break;
1949                 }
1950             }
1951             paint_util_set_segment_support_height(
1952                 session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
1953             paint_util_set_general_support_height(session, height + 72, 0x20);
1954             break;
1955         case 2:
1956             if (trackElement.HasChain())
1957             {
1958                 switch (direction)
1959                 {
1960                     case 2:
1961                         PaintAddImageAsParentRotated(
1962                             session, direction, session->TrackColours[SCHEME_TRACK] | 28517, -16, -16, 32, 32, 1, height + 24,
1963                             -16, -16, height + 32);
1964                         break;
1965                 }
1966             }
1967             else
1968             {
1969                 switch (direction)
1970                 {
1971                     case 2:
1972                         PaintAddImageAsParentRotated(
1973                             session, direction, session->TrackColours[SCHEME_TRACK] | 28501, -16, -16, 32, 32, 1, height + 24,
1974                             -16, -16, height + 32);
1975                         break;
1976                 }
1977             }
1978             paint_util_set_segment_support_height(
1979                 session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
1980             paint_util_set_general_support_height(session, height + 72, 0x20);
1981             break;
1982         case 3:
1983             if (trackElement.HasChain())
1984             {
1985                 switch (direction)
1986                 {
1987                     case 1:
1988                         PaintAddImageAsParentRotated(
1989                             session, direction, session->TrackColours[SCHEME_TRACK] | 28516, -16, -16, 32, 32, 1, height + 24,
1990                             -16, -16, height + 32);
1991                         break;
1992                 }
1993             }
1994             else
1995             {
1996                 switch (direction)
1997                 {
1998                     case 1:
1999                         PaintAddImageAsParentRotated(
2000                             session, direction, session->TrackColours[SCHEME_TRACK] | 28500, -16, -16, 32, 32, 1, height + 24,
2001                             -16, -16, height + 32);
2002                         break;
2003                 }
2004             }
2005 
2006             paint_util_set_segment_support_height(
2007                 session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
2008             switch (direction)
2009             {
2010                 case 0:
2011                     metal_b_supports_paint_setup(
2012                         session, METAL_SUPPORTS_FORK, 1, 0, height + 36, session->TrackColours[SCHEME_SUPPORTS]);
2013                     break;
2014                 case 1:
2015                     metal_a_supports_paint_setup(
2016                         session, METAL_SUPPORTS_FORK_ALT, 0, 0, height + 36, session->TrackColours[SCHEME_SUPPORTS]);
2017                     break;
2018                 case 2:
2019                     metal_a_supports_paint_setup(
2020                         session, METAL_SUPPORTS_FORK, 2, 0, height + 36, session->TrackColours[SCHEME_SUPPORTS]);
2021                     break;
2022                 case 3:
2023                     metal_a_supports_paint_setup(
2024                         session, METAL_SUPPORTS_FORK_ALT, 3, 0, height + 36, session->TrackColours[SCHEME_SUPPORTS]);
2025                     break;
2026             }
2027 
2028             paint_util_set_general_support_height(session, height + 72, 0x20);
2029             break;
2030     }
2031 }
2032 
2033 /** rct2: 0x008B003C */
mini_suspended_rc_track_diag_25_deg_down(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)2034 static void mini_suspended_rc_track_diag_25_deg_down(
2035     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
2036     const TrackElement& trackElement)
2037 {
2038     switch (trackSequence)
2039     {
2040         case 0:
2041             if (trackElement.HasChain())
2042             {
2043                 switch (direction)
2044                 {
2045                     case 3:
2046                         PaintAddImageAsParentRotated(
2047                             session, direction, session->TrackColours[SCHEME_TRACK] | 28520, -16, -16, 32, 32, 1, height + 24,
2048                             -16, -16, height + 40);
2049                         break;
2050                 }
2051             }
2052             else
2053             {
2054                 switch (direction)
2055                 {
2056                     case 3:
2057                         PaintAddImageAsParentRotated(
2058                             session, direction, session->TrackColours[SCHEME_TRACK] | 28504, -16, -16, 32, 32, 1, height + 24,
2059                             -16, -16, height + 40);
2060                         break;
2061                 }
2062             }
2063             paint_util_set_segment_support_height(
2064                 session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
2065             paint_util_set_general_support_height(session, height + 72, 0x20);
2066             break;
2067         case 1:
2068             if (trackElement.HasChain())
2069             {
2070                 switch (direction)
2071                 {
2072                     case 0:
2073                         PaintAddImageAsParentRotated(
2074                             session, direction, session->TrackColours[SCHEME_TRACK] | 28521, -16, -16, 32, 32, 1, height + 24,
2075                             -16, -16, height + 40);
2076                         break;
2077                 }
2078             }
2079             else
2080             {
2081                 switch (direction)
2082                 {
2083                     case 0:
2084                         PaintAddImageAsParentRotated(
2085                             session, direction, session->TrackColours[SCHEME_TRACK] | 28505, -16, -16, 32, 32, 1, height + 24,
2086                             -16, -16, height + 40);
2087                         break;
2088                 }
2089             }
2090             paint_util_set_segment_support_height(
2091                 session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
2092             paint_util_set_general_support_height(session, height + 72, 0x20);
2093             break;
2094         case 2:
2095             if (trackElement.HasChain())
2096             {
2097                 switch (direction)
2098                 {
2099                     case 2:
2100                         PaintAddImageAsParentRotated(
2101                             session, direction, session->TrackColours[SCHEME_TRACK] | 28519, -16, -16, 32, 32, 1, height + 24,
2102                             -16, -16, height + 40);
2103                         break;
2104                 }
2105             }
2106             else
2107             {
2108                 switch (direction)
2109                 {
2110                     case 2:
2111                         PaintAddImageAsParentRotated(
2112                             session, direction, session->TrackColours[SCHEME_TRACK] | 28503, -16, -16, 32, 32, 1, height + 24,
2113                             -16, -16, height + 40);
2114                         break;
2115                 }
2116             }
2117             paint_util_set_segment_support_height(
2118                 session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
2119             paint_util_set_general_support_height(session, height + 72, 0x20);
2120             break;
2121         case 3:
2122             if (trackElement.HasChain())
2123             {
2124                 switch (direction)
2125                 {
2126                     case 1:
2127                         PaintAddImageAsParentRotated(
2128                             session, direction, session->TrackColours[SCHEME_TRACK] | 28522, -16, -16, 32, 32, 1, height + 24,
2129                             -16, -16, height + 40);
2130                         break;
2131                 }
2132             }
2133             else
2134             {
2135                 switch (direction)
2136                 {
2137                     case 1:
2138                         PaintAddImageAsParentRotated(
2139                             session, direction, session->TrackColours[SCHEME_TRACK] | 28506, -16, -16, 32, 32, 1, height + 24,
2140                             -16, -16, height + 40);
2141                         break;
2142                 }
2143             }
2144 
2145             paint_util_set_segment_support_height(
2146                 session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
2147             switch (direction)
2148             {
2149                 case 0:
2150                     metal_a_supports_paint_setup(
2151                         session, METAL_SUPPORTS_FORK, 1, 0, height + 42, session->TrackColours[SCHEME_SUPPORTS]);
2152                     break;
2153                 case 1:
2154                     metal_a_supports_paint_setup(
2155                         session, METAL_SUPPORTS_FORK_ALT, 0, 0, height + 42, session->TrackColours[SCHEME_SUPPORTS]);
2156                     break;
2157                 case 2:
2158                     metal_a_supports_paint_setup(
2159                         session, METAL_SUPPORTS_FORK, 2, 0, height + 42, session->TrackColours[SCHEME_SUPPORTS]);
2160                     break;
2161                 case 3:
2162                     metal_a_supports_paint_setup(
2163                         session, METAL_SUPPORTS_FORK_ALT, 3, 0, height + 42, session->TrackColours[SCHEME_SUPPORTS]);
2164                     break;
2165             }
2166 
2167             paint_util_set_general_support_height(session, height + 72, 0x20);
2168             break;
2169     }
2170 }
2171 
2172 /** rct2: 0x008B001C */
mini_suspended_rc_track_diag_flat_to_25_deg_down(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)2173 static void mini_suspended_rc_track_diag_flat_to_25_deg_down(
2174     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
2175     const TrackElement& trackElement)
2176 {
2177     switch (trackSequence)
2178     {
2179         case 0:
2180             if (trackElement.HasChain())
2181             {
2182                 switch (direction)
2183                 {
2184                     case 3:
2185                         PaintAddImageAsParentRotated(
2186                             session, direction, session->TrackColours[SCHEME_TRACK] | 28516, -16, -16, 32, 32, 1, height + 24,
2187                             -16, -16, height + 32);
2188                         break;
2189                 }
2190             }
2191             else
2192             {
2193                 switch (direction)
2194                 {
2195                     case 3:
2196                         PaintAddImageAsParentRotated(
2197                             session, direction, session->TrackColours[SCHEME_TRACK] | 28500, -16, -16, 32, 32, 1, height + 24,
2198                             -16, -16, height + 32);
2199                         break;
2200                 }
2201             }
2202             paint_util_set_segment_support_height(
2203                 session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
2204             break;
2205         case 1:
2206             if (trackElement.HasChain())
2207             {
2208                 switch (direction)
2209                 {
2210                     case 0:
2211                         PaintAddImageAsParentRotated(
2212                             session, direction, session->TrackColours[SCHEME_TRACK] | 28517, -16, -16, 32, 32, 1, height + 24,
2213                             -16, -16, height + 32);
2214                         break;
2215                 }
2216             }
2217             else
2218             {
2219                 switch (direction)
2220                 {
2221                     case 0:
2222                         PaintAddImageAsParentRotated(
2223                             session, direction, session->TrackColours[SCHEME_TRACK] | 28501, -16, -16, 32, 32, 1, height + 24,
2224                             -16, -16, height + 32);
2225                         break;
2226                 }
2227             }
2228             paint_util_set_segment_support_height(
2229                 session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
2230             break;
2231         case 2:
2232             if (trackElement.HasChain())
2233             {
2234                 switch (direction)
2235                 {
2236                     case 2:
2237                         PaintAddImageAsParentRotated(
2238                             session, direction, session->TrackColours[SCHEME_TRACK] | 28515, -16, -16, 32, 32, 1, height + 24,
2239                             -16, -16, height + 32);
2240                         break;
2241                 }
2242             }
2243             else
2244             {
2245                 switch (direction)
2246                 {
2247                     case 2:
2248                         PaintAddImageAsParentRotated(
2249                             session, direction, session->TrackColours[SCHEME_TRACK] | 28499, -16, -16, 32, 32, 1, height + 24,
2250                             -16, -16, height + 32);
2251                         break;
2252                 }
2253             }
2254             paint_util_set_segment_support_height(
2255                 session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
2256             break;
2257         case 3:
2258             if (trackElement.HasChain())
2259             {
2260                 switch (direction)
2261                 {
2262                     case 1:
2263                         PaintAddImageAsParentRotated(
2264                             session, direction, session->TrackColours[SCHEME_TRACK] | 28518, -16, -16, 32, 32, 1, height + 24,
2265                             -16, -16, height + 32);
2266                         break;
2267                 }
2268             }
2269             else
2270             {
2271                 switch (direction)
2272                 {
2273                     case 1:
2274                         PaintAddImageAsParentRotated(
2275                             session, direction, session->TrackColours[SCHEME_TRACK] | 28502, -16, -16, 32, 32, 1, height + 24,
2276                             -16, -16, height + 32);
2277                         break;
2278                 }
2279             }
2280 
2281             paint_util_set_segment_support_height(
2282                 session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
2283             switch (direction)
2284             {
2285                 case 0:
2286                     metal_a_supports_paint_setup(
2287                         session, METAL_SUPPORTS_FORK, 1, 0, height + 36, session->TrackColours[SCHEME_SUPPORTS]);
2288                     break;
2289                 case 1:
2290                     metal_a_supports_paint_setup(
2291                         session, METAL_SUPPORTS_FORK_ALT, 0, 0, height + 36, session->TrackColours[SCHEME_SUPPORTS]);
2292                     break;
2293                 case 2:
2294                     metal_a_supports_paint_setup(
2295                         session, METAL_SUPPORTS_FORK, 2, 0, height + 36, session->TrackColours[SCHEME_SUPPORTS]);
2296                     break;
2297                 case 3:
2298                     metal_a_supports_paint_setup(
2299                         session, METAL_SUPPORTS_FORK_ALT, 3, 0, height + 36, session->TrackColours[SCHEME_SUPPORTS]);
2300                     break;
2301             }
2302             break;
2303     }
2304 
2305     paint_util_set_general_support_height(session, height + 72, 0x20);
2306 }
2307 
2308 /** rct2: 0x008B002C */
mini_suspended_rc_track_diag_25_deg_down_to_flat(paint_session * session,const Ride * ride,uint8_t trackSequence,uint8_t direction,int32_t height,const TrackElement & trackElement)2309 static void mini_suspended_rc_track_diag_25_deg_down_to_flat(
2310     paint_session* session, const Ride* ride, uint8_t trackSequence, uint8_t direction, int32_t height,
2311     const TrackElement& trackElement)
2312 {
2313     switch (trackSequence)
2314     {
2315         case 0:
2316             if (trackElement.HasChain())
2317             {
2318                 switch (direction)
2319                 {
2320                     case 3:
2321                         PaintAddImageAsParentRotated(
2322                             session, direction, session->TrackColours[SCHEME_TRACK] | 28512, -16, -16, 32, 32, 1, height + 24,
2323                             -16, -16, height + 32);
2324                         break;
2325                 }
2326             }
2327             else
2328             {
2329                 switch (direction)
2330                 {
2331                     case 3:
2332                         PaintAddImageAsParentRotated(
2333                             session, direction, session->TrackColours[SCHEME_TRACK] | 28496, -16, -16, 32, 32, 1, height + 24,
2334                             -16, -16, height + 32);
2335                         break;
2336                 }
2337             }
2338             paint_util_set_segment_support_height(
2339                 session, paint_util_rotate_segments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0);
2340             paint_util_set_general_support_height(session, height + 64, 0x20);
2341             break;
2342         case 1:
2343             if (trackElement.HasChain())
2344             {
2345                 switch (direction)
2346                 {
2347                     case 0:
2348                         PaintAddImageAsParentRotated(
2349                             session, direction, session->TrackColours[SCHEME_TRACK] | 28513, -16, -16, 32, 32, 1, height + 24,
2350                             -16, -16, height + 32);
2351                         break;
2352                 }
2353             }
2354             else
2355             {
2356                 switch (direction)
2357                 {
2358                     case 0:
2359                         PaintAddImageAsParentRotated(
2360                             session, direction, session->TrackColours[SCHEME_TRACK] | 28497, -16, -16, 32, 32, 1, height + 24,
2361                             -16, -16, height + 32);
2362                         break;
2363                 }
2364             }
2365             paint_util_set_segment_support_height(
2366                 session, paint_util_rotate_segments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0);
2367             paint_util_set_general_support_height(session, height + 64, 0x20);
2368             break;
2369         case 2:
2370             if (trackElement.HasChain())
2371             {
2372                 switch (direction)
2373                 {
2374                     case 2:
2375                         PaintAddImageAsParentRotated(
2376                             session, direction, session->TrackColours[SCHEME_TRACK] | 28511, -16, -16, 32, 32, 1, height + 24,
2377                             -16, -16, height + 32);
2378                         break;
2379                 }
2380             }
2381             else
2382             {
2383                 switch (direction)
2384                 {
2385                     case 2:
2386                         PaintAddImageAsParentRotated(
2387                             session, direction, session->TrackColours[SCHEME_TRACK] | 28495, -16, -16, 32, 32, 1, height + 24,
2388                             -16, -16, height + 32);
2389                         break;
2390                 }
2391             }
2392             paint_util_set_segment_support_height(
2393                 session, paint_util_rotate_segments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0);
2394             paint_util_set_general_support_height(session, height + 64, 0x20);
2395             break;
2396         case 3:
2397             if (trackElement.HasChain())
2398             {
2399                 switch (direction)
2400                 {
2401                     case 1:
2402                         PaintAddImageAsParentRotated(
2403                             session, direction, session->TrackColours[SCHEME_TRACK] | 28514, -16, -16, 32, 32, 1, height + 24,
2404                             -16, -16, height + 32);
2405                         break;
2406                 }
2407             }
2408             else
2409             {
2410                 switch (direction)
2411                 {
2412                     case 1:
2413                         PaintAddImageAsParentRotated(
2414                             session, direction, session->TrackColours[SCHEME_TRACK] | 28498, -16, -16, 32, 32, 1, height + 24,
2415                             -16, -16, height + 32);
2416                         break;
2417                 }
2418             }
2419 
2420             paint_util_set_segment_support_height(
2421                 session, paint_util_rotate_segments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0);
2422             switch (direction)
2423             {
2424                 case 0:
2425                     metal_a_supports_paint_setup(
2426                         session, METAL_SUPPORTS_FORK, 1, 0, height + 34, session->TrackColours[SCHEME_SUPPORTS]);
2427                     break;
2428                 case 1:
2429                     metal_a_supports_paint_setup(
2430                         session, METAL_SUPPORTS_FORK_ALT, 0, 0, height + 34, session->TrackColours[SCHEME_SUPPORTS]);
2431                     break;
2432                 case 2:
2433                     metal_a_supports_paint_setup(
2434                         session, METAL_SUPPORTS_FORK, 2, 0, height + 34, session->TrackColours[SCHEME_SUPPORTS]);
2435                     break;
2436                 case 3:
2437                     metal_a_supports_paint_setup(
2438                         session, METAL_SUPPORTS_FORK_ALT, 3, 0, height + 34, session->TrackColours[SCHEME_SUPPORTS]);
2439                     break;
2440             }
2441 
2442             paint_util_set_general_support_height(session, height + 64, 0x20);
2443             break;
2444     }
2445 }
2446 
get_track_paint_function_mini_suspended_rc(int32_t trackType)2447 TRACK_PAINT_FUNCTION get_track_paint_function_mini_suspended_rc(int32_t trackType)
2448 {
2449     switch (trackType)
2450     {
2451         case TrackElemType::Flat:
2452             return mini_suspended_rc_track_flat;
2453         case TrackElemType::EndStation:
2454         case TrackElemType::BeginStation:
2455         case TrackElemType::MiddleStation:
2456             return mini_suspended_rc_track_station;
2457         case TrackElemType::Up25:
2458             return mini_suspended_rc_track_25_deg_up;
2459         case TrackElemType::FlatToUp25:
2460             return mini_suspended_rc_track_flat_to_25_deg_up;
2461         case TrackElemType::Up25ToFlat:
2462             return mini_suspended_rc_track_25_deg_up_to_flat;
2463         case TrackElemType::Down25:
2464             return mini_suspended_rc_track_25_deg_down;
2465         case TrackElemType::FlatToDown25:
2466             return mini_suspended_rc_track_flat_to_25_deg_down;
2467         case TrackElemType::Down25ToFlat:
2468             return mini_suspended_rc_track_25_deg_down_to_flat;
2469         case TrackElemType::LeftQuarterTurn5Tiles:
2470             return mini_suspended_rc_track_left_quarter_turn_5;
2471         case TrackElemType::RightQuarterTurn5Tiles:
2472             return mini_suspended_rc_track_right_quarter_turn_5;
2473         case TrackElemType::SBendLeft:
2474             return mini_suspended_rc_track_s_bend_left;
2475         case TrackElemType::SBendRight:
2476             return mini_suspended_rc_track_s_bend_right;
2477         case TrackElemType::LeftQuarterTurn3Tiles:
2478             return mini_suspended_rc_track_left_quarter_turn_3;
2479         case TrackElemType::RightQuarterTurn3Tiles:
2480             return mini_suspended_rc_track_right_quarter_turn_3;
2481         case TrackElemType::LeftEighthToDiag:
2482             return mini_suspended_rc_track_left_eighth_to_diag;
2483         case TrackElemType::RightEighthToDiag:
2484             return mini_suspended_rc_track_right_eighth_to_diag;
2485         case TrackElemType::LeftEighthToOrthogonal:
2486             return mini_suspended_rc_track_left_eighth_to_orthogonal;
2487         case TrackElemType::RightEighthToOrthogonal:
2488             return mini_suspended_rc_track_right_eighth_to_orthogonal;
2489         case TrackElemType::DiagFlat:
2490             return mini_suspended_rc_track_diag_flat;
2491         case TrackElemType::DiagUp25:
2492             return mini_suspended_rc_track_diag_25_deg_up;
2493         case TrackElemType::DiagFlatToUp25:
2494             return mini_suspended_rc_track_diag_flat_to_25_deg_up;
2495         case TrackElemType::DiagUp25ToFlat:
2496             return mini_suspended_rc_track_diag_25_deg_up_to_flat;
2497         case TrackElemType::DiagDown25:
2498             return mini_suspended_rc_track_diag_25_deg_down;
2499         case TrackElemType::DiagFlatToDown25:
2500             return mini_suspended_rc_track_diag_flat_to_25_deg_down;
2501         case TrackElemType::DiagDown25ToFlat:
2502             return mini_suspended_rc_track_diag_25_deg_down_to_flat;
2503     }
2504     return nullptr;
2505 }
2506