From 6281e8b603b88f4e13dd6f54b31cafb1a8b0f4f5 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 28 Apr 2023 23:52:34 +0200 Subject: [PATCH] Use Corkscrew RC for 46 other Lay-down track elements --- .../ride/coaster/LayDownRollerCoaster.cpp | 6240 +---------------- 1 file changed, 133 insertions(+), 6107 deletions(-) diff --git a/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp b/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp index 5e690ba3a8..2774639fd7 100644 --- a/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp @@ -1435,51 +1435,9 @@ static void LayDownRCTrack25DegUpToLeftBank( { if (!trackElement.IsInverted()) { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16262), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16266), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 34 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16263), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16267), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 34 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16264), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16265), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - } - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); - } - else - { - PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::Up25ToLeftBank); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -1553,51 +1511,9 @@ static void LayDownRCTrack25DegUpToRightBank( { if (!trackElement.IsInverted()) { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16268), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16269), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16270), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16272), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 34 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16271), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16273), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 34 } }); - break; - } - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - } - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); - } - else - { - PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::Up25ToRightBank); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -1703,38 +1619,9 @@ static void LayDownRCTrackLeftBank( { if (!trackElement.IsInverted()) { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16274), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16275), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16276), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16277), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - } - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - } - PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::LeftBank); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -1792,178 +1679,9 @@ static void LayDownRCTrackLeftQuarterTurn525DegUp( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16510), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16515), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16520), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16525), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 1: - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 2: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16511), { 0, 0, height }, - { 32, 16, 3 }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16516), { 0, 0, height }, - { 32, 16, 3 }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16521), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16526), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 3: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16512), { 0, 0, height }, - { { 0, 16, height }, { 16, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16517), { 0, 0, height }, - { { 16, 16, height }, { 16, 16, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16522), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16527), { 0, 0, height }, - { 16, 16, 3 }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); - break; - case 4: - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 5: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16513), { 0, 0, height }, - { { 16, 0, height }, { 16, 32, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16518), { 0, 0, height }, - { 16, 32, 3 }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16523), { 0, 0, height }, - { 16, 32, 3 }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16528), { 0, 0, height }, - { { 16, 0, height }, { 16, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 6: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16514), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16519), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16524), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16529), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - switch (direction) - { - case 2: - PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); - break; - case 3: - PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::LeftQuarterTurn5TilesUp25); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -2155,178 +1873,9 @@ static void LayDownRCTrackRightQuarterTurn525DegUp( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16490), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16495), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16500), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16505), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 1: - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 2: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16491), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16496), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16501), { 0, 0, height }, - { 32, 16, 3 }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16506), { 0, 0, height }, - { 32, 16, 3 }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 3: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16492), { 0, 0, height }, - { 16, 16, 3 }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16497), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16502), { 0, 0, height }, - { { 16, 16, height }, { 16, 16, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16507), { 0, 0, height }, - { { 0, 16, height }, { 16, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); - break; - case 4: - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 5: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16493), { 0, 0, height }, - { { 16, 0, height }, { 16, 32, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16498), { 0, 0, height }, - { 16, 32, 3 }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16503), { 0, 0, height }, - { 16, 32, 3 }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16508), { 0, 0, height }, - { { 16, 0, height }, { 16, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 6: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16494), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16499), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16504), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16509), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - switch (direction) - { - case 0: - PaintUtilPushTunnelRight(session, height + 8, TUNNEL_2); - break; - case 1: - PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_2); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::RightQuarterTurn5TilesUp25); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -2536,152 +2085,9 @@ static void LayDownRCTrackSBendLeft( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16402), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16406), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16405), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16409), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16403), { 0, 0, height }, - { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16407), { 0, 0, height }, - { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16404), { 0, 0, height }, - { { 0, 6, height }, { 32, 26, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16408), { 0, 0, height }, - { { 0, 6, height }, { 32, 26, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16404), { 0, 0, height }, - { { 0, 6, height }, { 32, 26, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16408), { 0, 0, height }, - { { 0, 6, height }, { 32, 26, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16403), { 0, 0, height }, - { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16407), { 0, 0, height }, - { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 6, 1, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16405), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16409), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16402), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16406), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - switch (direction) - { - case 1: - PaintUtilPushTunnelRight(session, height, TUNNEL_0); - break; - case 2: - PaintUtilPushTunnelLeft(session, height, TUNNEL_0); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::SBendLeft); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -2863,152 +2269,9 @@ static void LayDownRCTrackSBendRight( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16410), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16414), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16413), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16417), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16411), { 0, 0, height }, - { { 0, 6, height }, { 32, 26, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16415), { 0, 0, height }, - { { 0, 6, height }, { 32, 26, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16412), { 0, 0, height }, - { 32, 26, 3 }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16416), { 0, 0, height }, - { 32, 26, 3 }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16412), { 0, 0, height }, - { 32, 26, 3 }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16416), { 0, 0, height }, - { 32, 26, 3 }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16411), { 0, 0, height }, - { { 0, 6, height }, { 32, 26, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16415), { 0, 0, height }, - { { 0, 6, height }, { 32, 26, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16413), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16417), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16410), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16414), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - switch (direction) - { - case 1: - PaintUtilPushTunnelRight(session, height, TUNNEL_0); - break; - case 2: - PaintUtilPushTunnelLeft(session, height, TUNNEL_0); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::SBendRight); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -3183,562 +2446,6 @@ static void LayDownRCTrackSBendRight( } } -/** rct2: 0x00824B6C */ -static void LayDownRCTrackLeftVerticalLoop( - PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TrackElement& trackElement) -{ - switch (trackSequence) - { - case 0: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16562), { 0, 6, height }, - { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16570), { 0, 6, height }, - { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16569), { 0, 6, height }, - { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16577), { 0, 6, height }, - { 32, 20, 7 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16563), { 0, 0, height }, - { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16571), { 0, 14, height }, - { 32, 2, 63 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16568), { 0, 6, height }, - { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16576), { 0, 6, height }, - { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 2: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16564), { 16, 0, height }, - { { 16, 0, height }, { 3, 16, 119 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16572), { 12, 0, height }, - { { 12, 0, height }, { 3, 16, 119 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16567), { 10, 16, height }, - { { 10, 16, height }, { 4, 16, 119 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16575), { 16, 16, height }, - { { 16, 16, height }, { 2, 16, 119 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); - break; - case 3: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16565), { 0, 0, height + 32 }, - { 32, 16, 3 }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16573), { 0, 0, height + 32 }, - { 32, 16, 3 }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16566), { 0, 16, height + 32 }, - { 32, 16, 3 }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16574), { 0, 16, height + 32 }, - { 32, 16, 3 }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 4: - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 5: - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 6: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16566), { 0, 16, height + 32 }, - { 32, 16, 3 }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16574), { 0, 16, height + 32 }, - { 32, 16, 3 }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16565), { 0, 0, height + 32 }, - { 32, 16, 3 }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16573), { 0, 0, height + 32 }, - { 32, 16, 3 }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 7: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16567), { 10, 16, height }, - { { 10, 16, height }, { 4, 16, 119 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16575), { 16, 16, height }, - { { 16, 16, height }, { 2, 16, 119 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16564), { 16, 0, height }, - { { 16, 0, height }, { 3, 16, 119 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16572), { 12, 0, height }, - { { 12, 0, height }, { 3, 16, 119 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); - break; - case 8: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16568), { 0, 6, height }, - { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16576), { 0, 6, height }, - { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 10, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16563), { 0, 0, height }, - { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16571), { 0, 14, height }, - { 32, 2, 63 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 15, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 9: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16569), { 0, 6, height }, - { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16577), { 0, 6, height }, - { 32, 20, 7 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16562), { 0, 6, height }, - { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16570), { 0, 6, height }, - { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - switch (direction) - { - case 1: - PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); - break; - case 2: - PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - } -} - -/** rct2: 0x00824B7C */ -static void LayDownRCTrackRightVerticalLoop( - PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TrackElement& trackElement) -{ - switch (trackSequence) - { - case 0: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16593), { 0, 6, height }, - { 32, 20, 7 }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16585), { 0, 6, height }, - { 32, 20, 3 }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16586), { 0, 6, height }, - { 32, 20, 3 }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16578), { 0, 6, height }, - { 32, 20, 3 }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); - } - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16592), { 0, 6, height }, - { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16584), { 0, 6, height }, - { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16587), { 0, 14, height }, - { 32, 2, 63 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16579), { 0, 0, height }, - { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 2: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16591), { 16, 16, height }, - { { 16, 16, height }, { 2, 16, 119 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16583), { 10, 16, height }, - { { 10, 16, height }, { 4, 16, 119 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16588), { 12, 0, height }, - { { 12, 0, height }, { 3, 16, 119 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16580), { 16, 0, height }, - { { 16, 0, height }, { 2, 16, 119 } }); - break; - } - PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); - break; - case 3: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16590), { 0, 16, height + 32 }, - { 32, 16, 3 }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16582), { 0, 16, height + 32 }, - { 32, 16, 3 }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16589), { 0, 0, height + 32 }, - { 32, 16, 3 }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16581), { 0, 0, height + 32 }, - { 32, 16, 3 }); - break; - } - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 4: - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 5: - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 6: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16589), { 0, 0, height + 32 }, - { 32, 16, 3 }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16581), { 0, 0, height + 32 }, - { 32, 16, 3 }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16590), { 0, 16, height + 32 }, - { 32, 16, 3 }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16582), { 0, 16, height + 32 }, - { 32, 16, 3 }); - break; - } - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 7: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16588), { 12, 0, height }, - { { 12, 0, height }, { 3, 16, 119 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16580), { 16, 0, height }, - { { 16, 0, height }, { 2, 16, 119 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16591), { 16, 16, height }, - { { 16, 16, height }, { 2, 16, 119 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16583), { 10, 16, height }, - { { 10, 16, height }, { 4, 16, 119 } }); - break; - } - PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); - break; - case 8: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16587), { 0, 14, height }, - { 32, 2, 63 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 12, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16579), { 0, 0, height }, - { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 20, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16592), { 0, 6, height }, - { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16584), { 0, 6, height }, - { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 16, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 9: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16586), { 0, 6, height }, - { 32, 20, 3 }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16578), { 0, 6, height }, - { 32, 20, 3 }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16593), { 0, 6, height }, - { 32, 20, 7 }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16585), { 0, 6, height }, - { 32, 20, 3 }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - switch (direction) - { - case 1: - PaintUtilPushTunnelRight(session, height - 8, TUNNEL_1); - break; - case 2: - PaintUtilPushTunnelLeft(session, height - 8, TUNNEL_1); - break; - } - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - } - - TrackPaintUtilRightVerticalLoopSegments(session, direction, trackSequence); -} - /** rct2: 0x00824BBC */ static void LayDownRCTrackLeftQuarterTurn3( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, @@ -4619,1250 +3326,6 @@ static void LayDownRCTrackRightQuarterTurn325DegDown( LayDownRCTrackLeftQuarterTurn325DegUp(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); } -/** rct2: 0x00824C9C */ -static void LayDownRCTrackLeftHalfBankedHelixUpSmall( - PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TrackElement& trackElement) -{ - switch (trackSequence) - { - case 0: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16481), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16488), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16484), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16487), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16478), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16480), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16483), { 0, 0, height }, - { { 0, 0, height + 27 }, { 16, 16, 1 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16486), { 0, 0, height }, - { { 0, 16, height }, { 16, 16, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16477), { 0, 0, height }, - { { 16, 16, height }, { 16, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16479), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16482), { 0, 0, height }, - { { 27, 0, height }, { 1, 32, 26 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16485), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16489), { 0, 0, height }, - { { 27, 0, height }, { 1, 32, 26 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16476), { 0, 0, height }, - { { 6, 0, height + 8 }, { 20, 32, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - switch (direction) - { - case 2: - PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); - break; - case 3: - PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 4: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16478), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16481), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16488), { 0, 0, height }, - { { 27, 0, height }, { 1, 32, 26 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16484), { 0, 0, height }, - { { 27, 0, height }, { 1, 32, 26 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16487), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); - switch (direction) - { - case 0: - PaintUtilPushTunnelRight(session, height, TUNNEL_0); - break; - case 1: - PaintUtilPushTunnelLeft(session, height, TUNNEL_0); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 5: - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 6: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16477), { 0, 0, height }, - { { 16, 16, height }, { 16, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16480), { 0, 0, height }, - { { 0, 16, height }, { 16, 16, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16483), { 0, 0, height }, - { { 0, 0, height + 27 }, { 16, 16, 1 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16486), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 7: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16476), { 0, 0, height }, - { { 0, 6, height + 8 }, { 32, 20, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16479), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16482), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16485), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16489), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } -} - -/** rct2: 0x00824CAC */ -static void LayDownRCTrackRightHalfBankedHelixUpSmall( - PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TrackElement& trackElement) -{ - switch (trackSequence) - { - case 0: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16462), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16465), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16468), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16471), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16475), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16463), { 0, 0, height }, - { { 16, 16, height }, { 16, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16466), { 0, 0, height }, - { { 0, 16, height }, { 16, 16, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16469), { 0, 0, height }, - { { 0, 0, height + 27 }, { 16, 16, 1 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16472), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16464), { 0, 0, height }, - { { 6, 0, height + 8 }, { 20, 32, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16467), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16474), { 0, 0, height }, - { { 27, 0, height }, { 1, 32, 26 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16470), { 0, 0, height }, - { { 27, 0, height }, { 1, 32, 26 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16473), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - switch (direction) - { - case 0: - PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); - break; - case 1: - PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 4: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16465), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16468), { 0, 0, height }, - { { 27, 0, height }, { 1, 32, 26 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16471), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16475), { 0, 0, height }, - { { 27, 0, height }, { 1, 32, 26 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16462), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 2, height, session.TrackColours[SCHEME_SUPPORTS]); - switch (direction) - { - case 2: - PaintUtilPushTunnelRight(session, height, TUNNEL_0); - break; - case 3: - PaintUtilPushTunnelLeft(session, height, TUNNEL_0); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 5: - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 6: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16466), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16469), { 0, 0, height }, - { { 0, 0, height + 27 }, { 16, 16, 1 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16472), { 0, 0, height }, - { { 0, 16, height }, { 16, 16, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16463), { 0, 0, height }, - { { 16, 16, height }, { 16, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 7: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16467), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16474), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16470), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16473), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16464), { 0, 0, height }, - { { 0, 6, height + 8 }, { 32, 20, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 6, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } -} - -/** rct2: 0x00824CBC */ -static void LayDownRCTrackLeftHalfBankedHelixDownSmall( - PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TrackElement& trackElement) -{ - if (trackSequence >= 4) - { - trackSequence -= 4; - direction = (direction - 1) & 3; - } - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - LayDownRCTrackRightHalfBankedHelixUpSmall(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); -} - -/** rct2: 0x00824CCC */ -static void LayDownRCTrackRightHalfBankedHelixDownSmall( - PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TrackElement& trackElement) -{ - if (trackSequence >= 4) - { - trackSequence -= 4; - direction = (direction + 1) & 3; - } - trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; - LayDownRCTrackLeftHalfBankedHelixUpSmall(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); -} - -/** rct2: 0x00824CDC */ -static void LayDownRCTrackLeftHalfBankedHelixUpLarge( - PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TrackElement& trackElement) -{ - switch (trackSequence) - { - case 0: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16449), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16460), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16454), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16459), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16444), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16448), { 0, 0, height }, - { { 0, 0, height }, { 32, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16453), { 0, 0, height }, - { { 0, 0, height + 27 }, { 32, 16, 1 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16458), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16443), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16447), { 0, 0, height }, - { { 0, 16, height }, { 16, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16452), { 0, 0, height }, - { { 16, 16, height + 27 }, { 16, 16, 1 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16457), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16442), { 0, 0, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 4: - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 5: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16446), { 0, 0, height }, - { { 16, 0, height }, { 16, 32, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16451), { 0, 0, height }, - { { 0, 0, height + 27 }, { 16, 32, 1 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16456), { 0, 0, height }, - { { 0, 0, height }, { 16, 32, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16441), { 0, 0, height }, - { { 16, 0, height }, { 16, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 6: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16445), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16450), { 0, 0, height }, - { { 27, 0, height }, { 1, 32, 26 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16455), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16461), { 0, 0, height }, - { { 27, 0, height }, { 1, 32, 26 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16440), { 0, 0, height }, - { { 6, 0, height + 8 }, { 20, 32, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); - switch (direction) - { - case 2: - PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); - break; - case 3: - PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 7: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16444), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16449), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16460), { 0, 0, height }, - { { 27, 0, height }, { 1, 32, 26 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16454), { 0, 0, height }, - { { 27, 0, height }, { 1, 32, 26 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16459), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); - switch (direction) - { - case 0: - PaintUtilPushTunnelRight(session, height, TUNNEL_0); - break; - case 1: - PaintUtilPushTunnelLeft(session, height, TUNNEL_0); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 8: - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 9: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16443), { 0, 0, height }, - { { 16, 0, height }, { 16, 32, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16448), { 0, 0, height }, - { { 0, 0, height }, { 16, 32, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16453), { 0, 0, height }, - { { 0, 0, height + 27 }, { 16, 32, 1 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16458), { 0, 0, height }, - { { 16, 0, height }, { 16, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 10: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16442), { 0, 0, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16447), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16452), { 0, 0, height }, - { { 16, 16, height + 27 }, { 16, 16, 1 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16457), { 0, 0, height }, - { { 0, 16, height }, { 16, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 11: - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 12: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16441), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16446), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16451), { 0, 0, height }, - { { 0, 0, height + 27 }, { 32, 16, 1 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16456), { 0, 0, height }, - { { 0, 0, height }, { 32, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 13: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16440), { 0, 0, height }, - { { 0, 6, height + 8 }, { 32, 20, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16445), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16450), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16455), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16461), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } -} - -/** rct2: 0x00824CEC */ -static void LayDownRCTrackRightHalfBankedHelixUpLarge( - PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TrackElement& trackElement) -{ - switch (trackSequence) - { - case 0: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16418), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16423), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16428), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16433), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16439), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16419), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16424), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16429), { 0, 0, height }, - { { 0, 0, height + 27 }, { 32, 16, 1 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16434), { 0, 0, height }, - { { 0, 0, height }, { 32, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16420), { 0, 0, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16425), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16430), { 0, 0, height }, - { { 16, 16, height + 27 }, { 16, 16, 1 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16435), { 0, 0, height }, - { { 0, 16, height }, { 16, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 4: - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 5: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16421), { 0, 0, height }, - { { 16, 0, height }, { 16, 32, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16426), { 0, 0, height }, - { { 0, 0, height }, { 16, 32, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16431), { 0, 0, height }, - { { 0, 0, height + 27 }, { 16, 32, 1 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16436), { 0, 0, height }, - { { 16, 0, height }, { 16, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 6: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16422), { 0, 0, height }, - { { 6, 0, height + 8 }, { 20, 32, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16427), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16438), { 0, 0, height }, - { { 27, 0, height }, { 1, 32, 26 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16432), { 0, 0, height }, - { { 27, 0, height }, { 1, 32, 26 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16437), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); - switch (direction) - { - case 0: - PaintUtilPushTunnelRight(session, height + 8, TUNNEL_0); - break; - case 1: - PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_0); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 7: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16423), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16428), { 0, 0, height }, - { { 27, 0, height }, { 1, 32, 26 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16433), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16439), { 0, 0, height }, - { { 27, 0, height }, { 1, 32, 26 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16418), { 0, 0, height }, - { { 6, 0, height }, { 20, 32, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 1, height, session.TrackColours[SCHEME_SUPPORTS]); - switch (direction) - { - case 2: - PaintUtilPushTunnelRight(session, height, TUNNEL_0); - break; - case 3: - PaintUtilPushTunnelLeft(session, height, TUNNEL_0); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 8: - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 9: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16424), { 0, 0, height }, - { { 16, 0, height }, { 16, 32, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16429), { 0, 0, height }, - { { 0, 0, height + 27 }, { 16, 32, 1 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16434), { 0, 0, height }, - { { 0, 0, height }, { 16, 32, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16419), { 0, 0, height }, - { { 16, 0, height }, { 16, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 10: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16425), { 0, 0, height }, - { { 0, 16, height }, { 16, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16430), { 0, 0, height }, - { { 16, 16, height + 27 }, { 16, 16, 1 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16435), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16420), { 0, 0, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 11: - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 12: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16426), { 0, 0, height }, - { { 0, 0, height }, { 32, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16431), { 0, 0, height }, - { { 0, 0, height + 27 }, { 32, 16, 1 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16436), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16421), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 13: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16427), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16438), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16432), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16437), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16422), { 0, 0, height }, - { { 0, 6, height + 8 }, { 32, 20, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 7, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } -} - -/** rct2: 0x00824CFC */ -static void LayDownRCTrackLeftHalfBankedHelixDownLarge( - PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TrackElement& trackElement) -{ - if (trackSequence >= 7) - { - trackSequence -= 7; - direction = (direction - 1) & 3; - } - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - LayDownRCTrackRightHalfBankedHelixUpLarge(session, ride, trackSequence, (direction + 1) & 3, height, trackElement); -} - -/** rct2: 0x00824D0C */ -static void LayDownRCTrackRightHalfBankedHelixDownLarge( - PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, - const TrackElement& trackElement) -{ - if (trackSequence >= 7) - { - trackSequence -= 7; - direction = (direction + 1) & 3; - } - trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; - LayDownRCTrackLeftHalfBankedHelixUpLarge(session, ride, trackSequence, (direction - 1) & 3, height, trackElement); -} - /** rct2: 0x00824D3C */ static void LayDownRCTrackLeftQuarterTurn160DegUp( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, @@ -5870,41 +3333,9 @@ static void LayDownRCTrackLeftQuarterTurn160DegUp( { if (!trackElement.IsInverted()) { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16555), { 0, 0, height }, - { { 2, 2, height }, { 28, 28, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16559), { 0, 0, height }, - { { 2, 2, height + 99 }, { 28, 28, 1 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16556), { 0, 0, height }, - { { 2, 2, height }, { 28, 28, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16560), { 0, 0, height }, - { { 2, 2, height + 99 }, { 28, 28, 1 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16557), { 0, 0, height }, - { { 2, 2, height }, { 28, 28, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16561), { 0, 0, height }, - { { 2, 2, height + 99 }, { 28, 28, 1 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16554), { 0, 0, height }, - { { 2, 2, height }, { 28, 28, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16558), { 0, 0, height }, - { { 2, 2, height + 99 }, { 28, 28, 1 } }); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::LeftQuarterTurn1TileUp60); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -5943,10 +3374,11 @@ static void LayDownRCTrackLeftQuarterTurn160DegUp( { { 2, 2, height + 99 }, { 28, 28, 1 } }); break; } + + TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); + PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } - TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } /** rct2: 0x00824D1C */ @@ -5956,41 +3388,9 @@ static void LayDownRCTrackRightQuarterTurn160DegUp( { if (!trackElement.IsInverted()) { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16546), { 0, 0, height }, - { { 2, 2, height }, { 28, 28, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16550), { 0, 0, height }, - { { 2, 2, height + 99 }, { 28, 28, 1 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16547), { 0, 0, height }, - { { 2, 2, height }, { 28, 28, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16551), { 0, 0, height }, - { { 2, 2, height + 99 }, { 28, 28, 1 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16548), { 0, 0, height }, - { { 2, 2, height }, { 28, 28, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16552), { 0, 0, height }, - { { 2, 2, height + 99 }, { 28, 28, 1 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16549), { 0, 0, height }, - { { 2, 2, height }, { 28, 28, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16553), { 0, 0, height }, - { { 2, 2, height + 99 }, { 28, 28, 1 } }); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::RightQuarterTurn1TileUp60); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -6059,30 +3459,9 @@ static void LayDownRCTrackBrakes( { if (!trackElement.IsInverted()) { - switch (direction) - { - case 0: - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16230), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 1: - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16231), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - } - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - } - PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::Brakes); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -6122,57 +3501,9 @@ static void LayDownRCTrackOnRidePhoto( { if (!trackElement.IsInverted()) { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16224), { 0, 0, height }, - { { 0, 6, height + 3 }, { 32, 20, 0 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16225), { 0, 0, height }, - { { 0, 6, height + 3 }, { 32, 20, 0 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 5, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 8, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16224), { 0, 0, height }, - { { 0, 6, height + 3 }, { 32, 20, 0 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, ImageId(SPR_STATION_BASE_D, COLOUR_BLACK), { 0, 0, height }, { 32, 32, 1 }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 6, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 7, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16225), { 0, 0, height }, - { { 0, 6, height + 3 }, { 32, 20, 0 } }); - break; - } - TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); - PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::OnRidePhoto); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -6237,147 +3568,9 @@ static void LayDownRCTrackLeftEighthToDiag( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16740), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16744), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16748), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16752), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16741), { 0, 0, height }, - { { 0, 0, height }, { 32, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16745), { 0, 0, height }, - { { 0, 0, height }, { 34, 16, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16749), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16753), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16742), { 0, 0, height }, - { { 0, 16, height }, { 16, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16746), { 0, 0, height }, - { { 16, 16, height }, { 16, 16, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16750), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16754), { 0, 0, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 4: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16743), { 0, 0, height }, - { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16747), { 0, 0, height }, - { { 0, 16, height }, { 16, 18, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16751), { 0, 0, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16755), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::LeftEighthToDiag); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -6547,147 +3740,9 @@ static void LayDownRCTrackRightEighthToDiag( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16724), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16728), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16732), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16736), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16725), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16729), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16733), { 0, 0, height }, - { { 0, 0, height }, { 34, 16, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16737), { 0, 0, height }, - { { 0, 0, height }, { 32, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16726), { 0, 0, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16730), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16734), { 0, 0, height }, - { { 4, 4, height }, { 28, 28, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16738), { 0, 0, height }, - { { 0, 16, height }, { 16, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 4: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16727), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16731), { 0, 0, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16735), { 0, 0, height }, - { { 0, 16, height }, { 16, 18, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16739), { 0, 0, height }, - { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::RightEighthToDiag); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -6875,147 +3930,9 @@ static void LayDownRCTrackLeftEighthBankToDiag( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16772), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16776), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16780), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16784), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16773), { 0, 0, height }, - { { 0, 0, height }, { 32, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16777), { 0, 0, height }, - { { 0, 0, height + 27 }, { 34, 16, 0 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16781), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16785), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16774), { 0, 0, height }, - { { 0, 16, height }, { 16, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16778), { 0, 0, height }, - { { 16, 16, height + 27 }, { 16, 16, 0 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16782), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16786), { 0, 0, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 4: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16775), { 0, 0, height }, - { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16779), { 0, 0, height }, - { { 0, 16, height + 27 }, { 16, 18, 0 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16783), { 0, 0, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16787), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::LeftEighthBankToDiag); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -7185,147 +4102,9 @@ static void LayDownRCTrackRightEighthBankToDiag( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16756), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16760), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16764), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16768), { 0, 0, height }, - { { 0, 27, height }, { 32, 1, 26 } }); - break; - } - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - if (direction == 0 || direction == 3) - { - PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16757), { 0, 0, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16761), { 0, 0, height }, - { { 0, 16, height }, { 32, 16, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16765), { 0, 0, height }, - { { 0, 0, height + 27 }, { 34, 16, 0 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16769), { 0, 0, height }, - { { 0, 0, height }, { 32, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16758), { 0, 0, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16762), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16766), { 0, 0, height }, - { { 4, 4, height + 27 }, { 28, 28, 0 } }); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16770), { 0, 0, height }, - { { 0, 16, height }, { 16, 16, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 4: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16759), { 0, 0, height }, - { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16763), { 0, 0, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16767), { 0, 0, height }, - { { 0, 16, height + 27 }, { 16, 18, 0 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16771), { 0, 0, height }, - { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, - PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), - 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::RightEighthBankToDiag); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -7513,145 +4292,9 @@ static void LayDownRCTrackDiagFlat( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - if (trackElement.HasChain()) - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16699), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16637), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16696), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16634), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - if (trackElement.HasChain()) - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16698), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16636), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16697), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - else - { - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16635), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagFlat); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -7797,145 +4440,9 @@ static void LayDownRCTrackDiag25DegUp( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - if (trackElement.HasChain()) - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16711), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16649), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 1: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16708), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16646), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 2: - if (trackElement.HasChain()) - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16710), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16648), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 3: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16709), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - else - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16647), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagUp25); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -8081,145 +4588,9 @@ static void LayDownRCTrackDiag60DegUp( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - if (trackElement.HasChain()) - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16723), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16661), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); - break; - case 1: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16720), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16658), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); - break; - case 2: - if (trackElement.HasChain()) - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16722), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16660), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); - break; - case 3: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 32, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16721), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 32, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - else - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 32, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16659), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 36, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 32, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 36, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagUp60); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -8313,145 +4684,9 @@ static void LayDownRCTrackDiagFlatTo25DegUp( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - if (trackElement.HasChain()) - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16703), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16641), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 1: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16700), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16638), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 2: - if (trackElement.HasChain()) - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16702), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16640), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 3: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16701), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - else - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16639), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagFlatToUp25); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -8597,145 +4832,9 @@ static void LayDownRCTrackDiag25DegUpTo60DegUp( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - if (trackElement.HasChain()) - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16715), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16653), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 1: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16712), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16650), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 2: - if (trackElement.HasChain()) - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16714), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16652), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 3: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16713), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - else - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 16, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16651), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 16, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 16, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 16, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagUp25ToUp60); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -8829,145 +4928,9 @@ static void LayDownRCTrackDiag60DegUpTo25DegUp( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - if (trackElement.HasChain()) - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16719), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16657), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 1: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16716), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16654), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 2: - if (trackElement.HasChain()) - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16718), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16656), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 3: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16717), { -16, -16, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - else - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 21, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16655), { -16, -16, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 21, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 21, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 21, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagUp60ToUp25); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -9061,145 +5024,9 @@ static void LayDownRCTrackDiag25DegUpToFlat( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - if (trackElement.HasChain()) - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16707), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16645), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 1: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16704), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16642), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 2: - if (trackElement.HasChain()) - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16706), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16644), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 3: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16705), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - else - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16643), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagUp25ToFlat); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -9345,145 +5172,9 @@ static void LayDownRCTrackDiag25DegDown( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - if (trackElement.HasChain()) - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16709), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16647), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 1: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16710), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16648), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 2: - if (trackElement.HasChain()) - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16708), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16646), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 3: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16711), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - else - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16649), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagDown25); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -9573,145 +5264,9 @@ static void LayDownRCTrackDiag60DegDown( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - if (trackElement.HasChain()) - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16721), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16659), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); - break; - case 1: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16722), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16660), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); - break; - case 2: - if (trackElement.HasChain()) - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16720), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16658), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); - break; - case 3: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16723), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - else - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 24, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16661), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 28, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 24, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 28, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagDown60); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -9805,141 +5360,9 @@ static void LayDownRCTrackDiagFlatTo25DegDown( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - if (trackElement.HasChain()) - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16705), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16643), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - break; - case 1: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16706), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16644), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - break; - case 2: - if (trackElement.HasChain()) - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16704), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16642), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - break; - case 3: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16707), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - else - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16645), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagFlatToDown25); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -10026,145 +5449,9 @@ static void LayDownRCTrackDiag25DegDownTo60DegDown( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - if (trackElement.HasChain()) - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16717), { -16, -16, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16655), { -16, -16, height }, - { { 0, 0, height }, { 16, 16, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 1: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16718), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16656), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 2: - if (trackElement.HasChain()) - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16716), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16654), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 3: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16719), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - else - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 17, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16657), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 17, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 17, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 17, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagDown25ToDown60); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -10258,145 +5545,9 @@ static void LayDownRCTrackDiag60DegDownTo25DegDown( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - if (trackElement.HasChain()) - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16713), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16651), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 1: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16714), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16652), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 2: - if (trackElement.HasChain()) - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16712), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16650), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - case 3: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16715), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - else - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16653), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 8, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagDown60ToDown25); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -10486,145 +5637,9 @@ static void LayDownRCTrackDiag25DegDownToFlat( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - if (trackElement.HasChain()) - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16701), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16639), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 1: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16702), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16640), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 2: - if (trackElement.HasChain()) - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16700), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - else - { - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16638), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 3: - if (trackElement.HasChain()) - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16703), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - else - { - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16641), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagDown25ToFlat); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -10714,78 +5729,9 @@ static void LayDownRCTrackDiagFlatToLeftBank( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16669), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16666), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16670), { -16, -16, height }, - { { -16, -16, height + 27 }, { 32, 32, 0 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16668), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16667), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagFlatToLeftBank); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -10876,78 +5822,9 @@ static void LayDownRCTrackDiagFlatToRightBank( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16674), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16671), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16673), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16675), { -16, -16, height }, - { { -16, -16, height + 27 }, { 32, 32, 0 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16672), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagFlatToRightBank); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -11038,78 +5915,9 @@ static void LayDownRCTrackDiagLeftBankToFlat( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16672), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16673), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16675), { -16, -16, height }, - { { -16, -16, height + 27 }, { 32, 32, 0 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16671), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16674), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagLeftBankToFlat); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -11200,78 +6008,9 @@ static void LayDownRCTrackDiagRightBankToFlat( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16667), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16668), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16666), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16670), { -16, -16, height }, - { { -16, -16, height + 27 }, { 32, 32, 0 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16669), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagRightBankToFlat); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -11362,78 +6101,9 @@ static void LayDownRCTrackDiagLeftBankTo25DegUp( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16689), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16686), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16690), { -16, -16, height }, - { { -16, -16, height + 35 }, { 32, 32, 0 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 2: - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16688), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 3: - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16687), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagLeftBankToUp25); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -11523,78 +6193,9 @@ static void LayDownRCTrackDiagRightBankTo25DegUp( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16694), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16691), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 2: - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16693), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16695), { -16, -16, height }, - { { -16, -16, height + 35 }, { 32, 32, 0 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 3: - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16692), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagRightBankToUp25); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -11684,78 +6285,9 @@ static void LayDownRCTrackDiag25DegUpToLeftBank( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16679), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16676), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16680), { -16, -16, height }, - { { -16, -16, height + 35 }, { 32, 32, 0 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 2: - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16678), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 3: - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16677), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagUp25ToLeftBank); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -11845,78 +6377,9 @@ static void LayDownRCTrackDiag25DegUpToRightBank( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16684), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16681), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 2: - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16683), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16685), { -16, -16, height }, - { { -16, -16, height + 35 }, { 32, 32, 0 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - case 3: - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16682), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagUp25ToRightBank); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -12006,74 +6469,9 @@ static void LayDownRCTrackDiagLeftBankTo25DegDown( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16682), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16683), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16685), { -16, -16, height }, - { { -16, -16, height + 35 }, { 32, 32, 0 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - break; - case 2: - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16681), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - break; - case 3: - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16684), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagLeftBankToDown25); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -12160,74 +6558,9 @@ static void LayDownRCTrackDiagRightBankTo25DegDown( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16677), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16678), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - break; - case 2: - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16676), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16680), { -16, -16, height }, - { { -16, -16, height + 35 }, { 32, 32, 0 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - break; - case 3: - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16679), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 4, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagRightBankToDown25); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -12314,78 +6647,9 @@ static void LayDownRCTrackDiag25DegDownToLeftBank( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16692), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16693), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16695), { -16, -16, height }, - { { -16, -16, height + 35 }, { 32, 32, 0 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 2: - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16691), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 3: - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16694), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagDown25ToLeftBank); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -12475,78 +6739,9 @@ static void LayDownRCTrackDiag25DegDownToRightBank( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16687), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16688), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 2: - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16686), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16690), { -16, -16, height }, - { { -16, -16, height + 35 }, { 32, 32, 0 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - case 3: - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16689), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagDown25ToRightBank); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -12636,75 +6831,9 @@ static void LayDownRCTrackDiagLeftBank( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16665), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16662), { -16, -16, height }, - { { -16, -16, height + 27 }, { 32, 32, 0 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16664), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16663), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagLeftBank); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -12795,75 +6924,9 @@ static void LayDownRCTrackDiagRightBank( { if (!trackElement.IsInverted()) { - switch (trackSequence) - { - case 0: - switch (direction) - { - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16663), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 1: - switch (direction) - { - case 0: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16664), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 2: - switch (direction) - { - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16662), { -16, -16, height }, - { { -16, -16, height + 27 }, { 32, 32, 0 } }); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - case 3: - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 1, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 1: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16665), { -16, -16, height }, - { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 0, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 2: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 2, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportType::TubesInverted, 3, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - break; - } - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); - break; - } + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::DiagRightBank); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -14073,26 +8136,9 @@ static void LayDownRCTrackBlockBrakes( { if (!trackElement.IsInverted()) { - switch (direction) - { - case 0: - case 2: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16232), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - case 1: - case 3: - PaintAddImageAsParentRotated( - session, direction, session.TrackColours[SCHEME_TRACK].WithIndex(16233), { 0, 0, height }, - { { 0, 6, height }, { 32, 20, 3 } }); - break; - } - MetalASupportsPaintSetup(session, MetalSupportType::TubesInverted, 4, 0, height, session.TrackColours[SCHEME_SUPPORTS]); - PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + auto function = GetTrackPaintFunctionCorkscrewRC(TrackElemType::BlockBrakes); + function(session, ride, trackSequence, direction, height, trackElement); + return; } else { @@ -15092,10 +9138,6 @@ TRACK_PAINT_FUNCTION GetTrackPaintFunctionLayDownRC(int32_t trackType) return LayDownRCTrackSBendLeft; case TrackElemType::SBendRight: return LayDownRCTrackSBendRight; - case TrackElemType::LeftVerticalLoop: - return LayDownRCTrackLeftVerticalLoop; - case TrackElemType::RightVerticalLoop: - return LayDownRCTrackRightVerticalLoop; case TrackElemType::LeftQuarterTurn3Tiles: return LayDownRCTrackLeftQuarterTurn3; case TrackElemType::RightQuarterTurn3Tiles: @@ -15112,22 +9154,6 @@ TRACK_PAINT_FUNCTION GetTrackPaintFunctionLayDownRC(int32_t trackType) return LayDownRCTrackLeftQuarterTurn325DegDown; case TrackElemType::RightQuarterTurn3TilesDown25: return LayDownRCTrackRightQuarterTurn325DegDown; - case TrackElemType::LeftHalfBankedHelixUpSmall: - return LayDownRCTrackLeftHalfBankedHelixUpSmall; - case TrackElemType::RightHalfBankedHelixUpSmall: - return LayDownRCTrackRightHalfBankedHelixUpSmall; - case TrackElemType::LeftHalfBankedHelixDownSmall: - return LayDownRCTrackLeftHalfBankedHelixDownSmall; - case TrackElemType::RightHalfBankedHelixDownSmall: - return LayDownRCTrackRightHalfBankedHelixDownSmall; - case TrackElemType::LeftHalfBankedHelixUpLarge: - return LayDownRCTrackLeftHalfBankedHelixUpLarge; - case TrackElemType::RightHalfBankedHelixUpLarge: - return LayDownRCTrackRightHalfBankedHelixUpLarge; - case TrackElemType::LeftHalfBankedHelixDownLarge: - return LayDownRCTrackLeftHalfBankedHelixDownLarge; - case TrackElemType::RightHalfBankedHelixDownLarge: - return LayDownRCTrackRightHalfBankedHelixDownLarge; case TrackElemType::LeftQuarterTurn1TileUp60: return LayDownRCTrackLeftQuarterTurn160DegUp; case TrackElemType::RightQuarterTurn1TileUp60: