From 64dea4cd5d54be7dc7e85ebfcce3fd8b1953d637 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 17 Aug 2024 00:13:08 +0200 Subject: [PATCH] Replace usages of MetalSupportGraphic with MetalSupportType --- .../paint/track/coaster/AlpineCoaster.cpp | 570 +---- .../track/coaster/FlyingRollerCoaster.cpp | 4 +- .../track/coaster/JuniorRollerCoaster.cpp | 218 +- .../track/coaster/LoopingRollerCoaster.cpp | 80 +- src/openrct2/paint/track/coaster/MineRide.cpp | 684 ++---- .../paint/track/coaster/MiniRollerCoaster.cpp | 2048 +++-------------- .../track/coaster/MiniSuspendedCoaster.cpp | 458 +--- .../paint/track/coaster/Steeplechase.cpp | 437 +--- .../track/coaster/WoodenRollerCoaster.cpp | 40 +- .../paint/track/gentle/MonorailCycles.cpp | 95 +- .../paint/track/thrill/MagicCarpet.cpp | 15 +- .../track/thrill/SwingingInverterShip.cpp | 15 +- .../paint/track/thrill/SwingingShip.cpp | 22 +- src/openrct2/ride/TrackPaint.cpp | 3 +- 14 files changed, 892 insertions(+), 3797 deletions(-) diff --git a/src/openrct2/paint/track/coaster/AlpineCoaster.cpp b/src/openrct2/paint/track/coaster/AlpineCoaster.cpp index bc0722347a..69901abeb3 100644 --- a/src/openrct2/paint/track/coaster/AlpineCoaster.cpp +++ b/src/openrct2/paint/track/coaster/AlpineCoaster.cpp @@ -855,33 +855,27 @@ namespace OpenRCT2::AlpineRC PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE + 3)), { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE + 7)), { 0, 0, height }, { { 0, 16, height }, { 16, 18, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE + 11)), { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE + 15)), { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, DirectionPrev(direction), 0, height, + session.SupportColours); + PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1021,33 +1015,26 @@ namespace OpenRCT2::AlpineRC PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE + 19)), { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::LeftCorner, 0, height, - session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE + 23)), { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopCorner, 0, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE + 27)), { 0, 0, height }, { { 0, 16, height }, { 16, 18, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::RightCorner, 0, height, - session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE + 31)), { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomCorner, 0, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomCorner, DirectionNext(direction), 0, height, + session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1205,27 +1192,11 @@ namespace OpenRCT2::AlpineRC { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 9, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_LIFT_TRACK_GENTLE_DIAGONAL + 1)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 9, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 9, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 9, height, - session.SupportColours); break; } } @@ -1233,29 +1204,15 @@ namespace OpenRCT2::AlpineRC { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 9, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_DIAGONAL + 1)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 9, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 9, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 9, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 9, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1382,27 +1339,11 @@ namespace OpenRCT2::AlpineRC { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_LIFT_TRACK_GENTLE_DIAGONAL + 5)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } @@ -1410,29 +1351,15 @@ namespace OpenRCT2::AlpineRC { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_DIAGONAL + 5)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1559,58 +1486,30 @@ namespace OpenRCT2::AlpineRC { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height + 2, - session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_LIFT_TRACK_GENTLE_DIAGONAL + 1)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height + 2, - session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, + height + (direction & 1) ? 0 : 2, session.SupportColours); } else { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 2, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_DIAGONAL + 1)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 2, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 2, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 2, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 2, height, + session.SupportColours); } PaintUtilSetSegmentSupportHeight( session, @@ -1738,27 +1637,11 @@ namespace OpenRCT2::AlpineRC { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 8, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_LIFT_TRACK_GENTLE_DIAGONAL + 11)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 8, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 8, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 8, height, - session.SupportColours); break; } } @@ -1766,29 +1649,15 @@ namespace OpenRCT2::AlpineRC { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 8, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_DIAGONAL + 11)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 8, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 8, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 8, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 8, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1912,27 +1781,11 @@ namespace OpenRCT2::AlpineRC { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 4, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_LIFT_TRACK_GENTLE_DIAGONAL + 7)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 4, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 4, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } } @@ -1940,29 +1793,15 @@ namespace OpenRCT2::AlpineRC { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 4, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_DIAGONAL + 7)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 4, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 4, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2090,27 +1929,11 @@ namespace OpenRCT2::AlpineRC { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_LIFT_TRACK_GENTLE_DIAGONAL + 3)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } } @@ -2118,29 +1941,15 @@ namespace OpenRCT2::AlpineRC { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_DIAGONAL + 3)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2606,29 +2415,15 @@ namespace OpenRCT2::AlpineRC case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 2)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2715,29 +2510,15 @@ namespace OpenRCT2::AlpineRC case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 6)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2824,29 +2605,15 @@ namespace OpenRCT2::AlpineRC case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 9)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2933,29 +2700,15 @@ namespace OpenRCT2::AlpineRC case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 4)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3042,29 +2795,15 @@ namespace OpenRCT2::AlpineRC case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 12)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3151,29 +2890,15 @@ namespace OpenRCT2::AlpineRC case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 16)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3260,29 +2985,15 @@ namespace OpenRCT2::AlpineRC case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 4, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 22)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 4, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 4, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3369,29 +3080,15 @@ namespace OpenRCT2::AlpineRC case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 4, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 26)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 4, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 4, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3475,29 +3172,15 @@ namespace OpenRCT2::AlpineRC case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 4, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 29)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 4, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 4, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3582,29 +3265,15 @@ namespace OpenRCT2::AlpineRC case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 4, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 24)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 4, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 4, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3692,29 +3361,15 @@ namespace OpenRCT2::AlpineRC case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 19)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3801,29 +3456,15 @@ namespace OpenRCT2::AlpineRC case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 14)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3906,29 +3547,15 @@ namespace OpenRCT2::AlpineRC case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 31)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4011,29 +3638,15 @@ namespace OpenRCT2::AlpineRC case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_BANK_TRANSITION_DIAGONAL + 33)), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4536,33 +4149,26 @@ namespace OpenRCT2::AlpineRC PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE_BANKED + 3)), { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE_BANKED + 7)), { 0, 0, height }, { { 0, 16, height + 27 }, { 16, 18, 0 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE_BANKED + 11)), { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE_BANKED + 15)), { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, DirectionPrev(direction), 0, height, + session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4702,33 +4308,26 @@ namespace OpenRCT2::AlpineRC PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE_BANKED + 19)), { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::LeftCorner, 0, height, - session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE_BANKED + 23)), { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopCorner, 0, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE_BANKED + 27)), { 0, 0, height }, { { 0, 16, height + 27 }, { 16, 18, 0 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::RightCorner, 0, height, - session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_CURVE_BANKED + 31)), { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomCorner, 0, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomCorner, DirectionNext(direction), 0, height, + session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4918,33 +4517,26 @@ namespace OpenRCT2::AlpineRC PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_SMALL_CURVE + 9)), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 8, height, - session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_SMALL_CURVE + 11)), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_SMALL_CURVE + 13)), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 10, height, - session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_GENTLE_SMALL_CURVE + 15)), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), direction == 2 ? 10 : 8, + height, session.SupportColours); switch (direction) { case 0: @@ -5465,8 +5057,8 @@ namespace OpenRCT2::AlpineRC PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_S_BEND + 5)), { 0, 0, height }, { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopRightSide, 1, height - 1, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction, 1, height - 1, session.SupportColours); break; case 2: @@ -5514,8 +5106,8 @@ namespace OpenRCT2::AlpineRC PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_S_BEND + 5)), { 0, 0, height }, { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopRightSide, 1, height - 1, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 1, height - 1, session.SupportColours); break; } @@ -5637,8 +5229,8 @@ namespace OpenRCT2::AlpineRC PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_S_BEND + 13)), { 0, 0, height }, { { 0, 6, height }, { 32, 26, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomLeftSide, 0, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 0, height, session.SupportColours); break; case 2: @@ -5686,8 +5278,8 @@ namespace OpenRCT2::AlpineRC PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_S_BEND + 13)), { 0, 0, height }, { { 0, 6, height }, { 32, 26, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomLeftSide, 0, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction, 0, height, session.SupportColours); break; } @@ -6881,9 +6473,6 @@ namespace OpenRCT2::AlpineRC PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_HELIX + 26)), { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, - session.SupportColours); break; case 1: PaintAddImageAsParentRotated( @@ -6892,25 +6481,21 @@ namespace OpenRCT2::AlpineRC PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_HELIX + 32)), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 5, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_HELIX + 37)), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, - session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_HELIX + 43)), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), direction == 1 ? 5 : 9, + height, session.SupportColours); switch (direction) { case 0: @@ -7097,33 +6682,26 @@ namespace OpenRCT2::AlpineRC PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_HELIX + 32)), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 5, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_HELIX + 37)), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, - session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_HELIX + 43)), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex((SPR_G2_ALPINE_TRACK_LARGE_HELIX + 26)), { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, direction == 0 ? 5 : 9, height, + session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height + 8, TunnelType::StandardFlat); diff --git a/src/openrct2/paint/track/coaster/FlyingRollerCoaster.cpp b/src/openrct2/paint/track/coaster/FlyingRollerCoaster.cpp index cd951209af..ceca565d56 100644 --- a/src/openrct2/paint/track/coaster/FlyingRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/FlyingRollerCoaster.cpp @@ -9911,8 +9911,8 @@ static void FlyingRCTrackDiagBrakesInverted( if (trackSequence == 3) { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, kDiagSupportPlacement[direction], 0, height + 39, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height + 39, session.SupportColours); } PaintUtilSetGeneralSupportHeight(session, height + 48); } diff --git a/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp b/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp index 4f9a574376..7eafa56cb6 100644 --- a/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/JuniorRollerCoaster.cpp @@ -3093,22 +3093,6 @@ static void JuniorRCSBendLeftPaintSetup( { PaintUtilPushTunnelLeft(session, height, TunnelType::StandardFlat); } - - switch (trackSequence) - { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopLeftSide, 0, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - } } else { @@ -3116,22 +3100,21 @@ static void JuniorRCSBendLeftPaintSetup( { PaintUtilPushTunnelRight(session, height, TunnelType::StandardFlat); } - - switch (trackSequence) - { - case 0: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopRightSide, 0, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - } + } + switch (trackSequence) + { + case 0: + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); + break; + case 1: + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction & 1, 0, height, session.SupportColours); + break; + case 3: + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); + break; } int32_t blockedSegments = 0; @@ -3203,22 +3186,6 @@ static void JuniorRCSBendRightPaintSetup( { PaintUtilPushTunnelLeft(session, height, TunnelType::StandardFlat); } - - switch (trackSequence) - { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomRightSide, 0, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - } } else { @@ -3226,23 +3193,22 @@ static void JuniorRCSBendRightPaintSetup( { PaintUtilPushTunnelRight(session, height, TunnelType::StandardFlat); } - - switch (trackSequence) - { - case 0: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomLeftSide, 0, height, - session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - } + } + switch (trackSequence) + { + case 0: + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); + break; + case 1: + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction & 1, 0, height, + session.SupportColours); + break; + case 3: + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); + break; } int32_t blockedSegments = 0; @@ -4149,18 +4115,9 @@ static void JuniorRCLeftEighthToDiagPaintSetup( session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); break; case 4: - if (direction == 0) - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, session.SupportColours); - if (direction == 1) - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - if (direction == 2) - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, session.SupportColours); - if (direction == 3) - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, DirectionPrev(direction), 0, height, + session.SupportColours); break; } @@ -4221,18 +4178,9 @@ static void JuniorRCRightEighthToDiagPaintSetup( session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); break; case 4: - if (direction == 0) - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - if (direction == 1) - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopCorner, 0, height, session.SupportColours); - if (direction == 2) - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - if (direction == 3) - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomCorner, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomCorner, DirectionNext(direction), 0, height, + session.SupportColours); break; } @@ -4392,18 +4340,8 @@ static void JuniorRCLeftEighthToDiagBankPaintSetup( session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); break; case 4: - if (direction == 0) - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomCorner, 0, height, session.SupportColours); - if (direction == 1) - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - if (direction == 2) - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopCorner, 0, height, session.SupportColours); - if (direction == 3) - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomCorner, direction, 0, height, session.SupportColours); break; } @@ -4545,18 +4483,8 @@ static void JuniorRCRightEighthToDiagBankPaintSetup( session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); break; case 4: - if (direction == 0) - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - if (direction == 1) - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height, session.SupportColours); - if (direction == 2) - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - if (direction == 3) - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); break; } @@ -4641,7 +4569,7 @@ static void JuniorRCTrackDiagBrakes( if (trackSequence == 3) { MetalASupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 0, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4660,7 +4588,7 @@ static void JuniorRCTrackDiagBlockBrakes( if (trackSequence == 3) { MetalASupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 0, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4681,7 +4609,7 @@ static void JuniorRCPaintTrackDiag25DegUp( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 8, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 8, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4702,7 +4630,7 @@ static void JuniorRCPaintTrackDiagFlatTo25DegUp( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 0, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4724,7 +4652,7 @@ static void JuniorRCPaintTrackDiagFlatTo60DegUp( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 0, height + 6, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height + 6, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4745,7 +4673,7 @@ static void JuniorRCPaintTrackDiag25DegUpToFlat( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 4, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4767,7 +4695,7 @@ static void JuniorRCPaintTrackDiag60DegUpToFlat( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 4, height + 13, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height + 13, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4788,7 +4716,7 @@ static void JuniorRCPaintTrackDiag25DegDown( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 8, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 8, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4809,7 +4737,7 @@ static void JuniorRCPaintTrackDiagFlatTo25DegDown( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 4, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4831,7 +4759,7 @@ static void JuniorRCPaintTrackDiagFlatTo60DegDown( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 4, height + 7, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height + 7, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4852,7 +4780,7 @@ static void JuniorRCPaintTrackDiag25DegDownToFlat( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 0, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4874,7 +4802,7 @@ static void JuniorRCPaintTrackDiag60DegDownToFlat( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 0, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4900,7 +4828,7 @@ static void JuniorRCDiagFlatToLeftBankPaintSetup( if (trackSequence == 3) { MetalASupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 0, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4926,7 +4854,7 @@ static void JuniorRCDiagFlatToRightBankPaintSetup( if (trackSequence == 3) { MetalASupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 0, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4952,7 +4880,7 @@ static void JuniorRCDiagLeftBankToFlatPaintSetup( if (trackSequence == 3) { MetalASupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 0, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -4978,7 +4906,7 @@ static void JuniorRCDiagRightBankToFlatPaintSetup( if (trackSequence == 3) { MetalASupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 0, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5004,7 +4932,7 @@ static void JuniorRCDiagLeftBankTo25DegUpPaintSetup( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 0, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5030,7 +4958,7 @@ static void JuniorRCDiagRightBankTo25DegUpPaintSetup( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 0, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5056,7 +4984,7 @@ static void JuniorRCDiag25DegUpToLeftBankPaintSetup( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 4, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5082,7 +5010,7 @@ static void JuniorRCDiag25DegUpToRightBankPaintSetup( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 4, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5108,7 +5036,7 @@ static void JuniorRCDiagLeftBankTo25DegDownPaintSetup( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 4, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5134,7 +5062,7 @@ static void JuniorRCDiagRightBankTo25DegDownPaintSetup( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 4, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5160,7 +5088,7 @@ static void JuniorRCDiag25DegDownToLeftBankPaintSetup( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 0, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5186,7 +5114,7 @@ static void JuniorRCDiag25DegDownToRightBankPaintSetup( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 0, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5221,7 +5149,7 @@ static void JuniorRCDiagLeftBankPaintSetup( if (trackSequence == 3) { MetalASupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 0, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5242,7 +5170,7 @@ static void JuniorRCDiagRightBankPaintSetup( if (trackSequence == 3) { MetalASupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 0, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5494,7 +5422,7 @@ static void JuniorRCPaintTrackDiag60DegUp( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 36, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 36, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5516,7 +5444,7 @@ static void JuniorRCPaintTrackDiag60DegDown( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 28, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 28, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5538,7 +5466,7 @@ static void JuniorRCPaintTrackDiag25DegUpTo60DegUp( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 16, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 16, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5570,7 +5498,7 @@ static void JuniorRCPaintTrackDiag60DegUpTo25DegUp( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 21, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 21, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5602,7 +5530,7 @@ static void JuniorRCPaintTrackDiag25DegDownTo60DegDown( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 17, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 17, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; @@ -5624,7 +5552,7 @@ static void JuniorRCPaintTrackDiag60DegDownTo25DegDown( if (trackSequence == 3) { MetalBSupportsPaintSetupRotated( - session, supportType.metal, kDiagSupportPlacement[direction], direction, 8, height, session.SupportColours); + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 8, height, session.SupportColours); } int32_t blockedSegments = BlockedSegments::kDiagStraightFlat[trackSequence]; diff --git a/src/openrct2/paint/track/coaster/LoopingRollerCoaster.cpp b/src/openrct2/paint/track/coaster/LoopingRollerCoaster.cpp index 77600468fb..122d765afb 100644 --- a/src/openrct2/paint/track/coaster/LoopingRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/LoopingRollerCoaster.cpp @@ -2355,9 +2355,9 @@ static void LoopingRCTrackLeftVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15350), { 16, 0, height }, { { 16, 0, height }, { 3, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ThickCentred, MetalSupportPlace::LeftCorner, 0, height - 8, - session.TrackColours); + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::RightCorner, DirectionReverse(direction), 0, + height - 8, session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15364), { 16, 0, height }, { { 16, 0, height }, { 3, 16, 119 } }); @@ -2366,9 +2366,9 @@ static void LoopingRCTrackLeftVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15358), { 12, 0, height }, { { 12, 0, height }, { 3, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ThickAltCentred, MetalSupportPlace::TopCorner, 0, height - 8, - session.TrackColours); + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::RightCorner, DirectionReverse(direction), 0, + height - 8, session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15366), { 12, 0, height }, { { 12, 0, height }, { 3, 16, 119 } }); @@ -2377,9 +2377,9 @@ static void LoopingRCTrackLeftVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15353), { 10, 16, height }, { { 10, 16, height }, { 4, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Thick, MetalSupportPlace::RightCorner, 0, height - 8, - session.TrackColours); + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::RightCorner, DirectionReverse(direction), 0, + height - 8, session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15365), { 10, 16, height }, { { 10, 16, height }, { 4, 16, 119 } }); @@ -2388,9 +2388,9 @@ static void LoopingRCTrackLeftVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15361), { 16, 16, height }, { { 16, 16, height }, { 2, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ThickAlt, MetalSupportPlace::BottomCorner, 0, height - 8, - session.TrackColours); + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::RightCorner, DirectionReverse(direction), 0, + height - 8, session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15367), { 16, 16, height }, { { 16, 16, height }, { 2, 16, 119 } }); @@ -2479,8 +2479,8 @@ static void LoopingRCTrackLeftVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15353), { 10, 16, height }, { { 10, 16, height }, { 4, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Thick, MetalSupportPlace::RightCorner, 0, height - 8, + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::RightCorner, direction, 0, height - 8, session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15365), { 10, 16, height }, @@ -2490,8 +2490,8 @@ static void LoopingRCTrackLeftVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15361), { 16, 16, height }, { { 16, 16, height }, { 2, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ThickAlt, MetalSupportPlace::BottomCorner, 0, height - 8, + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::RightCorner, direction, 0, height - 8, session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15367), { 16, 16, height }, @@ -2501,8 +2501,8 @@ static void LoopingRCTrackLeftVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15350), { 16, 0, height }, { { 16, 0, height }, { 3, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ThickCentred, MetalSupportPlace::LeftCorner, 0, height - 8, + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::RightCorner, direction, 0, height - 8, session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15364), { 16, 0, height }, @@ -2512,8 +2512,8 @@ static void LoopingRCTrackLeftVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15358), { 12, 0, height }, { { 12, 0, height }, { 3, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ThickAltCentred, MetalSupportPlace::TopCorner, 0, height - 8, + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::RightCorner, direction, 0, height - 8, session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15366), { 12, 0, height }, @@ -2664,8 +2664,8 @@ static void LoopingRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15381), { 16, 16, height }, { { 16, 16, height }, { 2, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Thick, MetalSupportPlace::BottomCorner, 0, height - 8, + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::BottomCorner, direction, 0, height - 8, session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15384), { 16, 16, height }, @@ -2675,8 +2675,8 @@ static void LoopingRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15373), { 10, 16, height }, { { 10, 16, height }, { 4, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ThickAlt, MetalSupportPlace::LeftCorner, 0, height - 8, + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::BottomCorner, direction, 0, height - 8, session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15386), { 10, 16, height }, @@ -2686,8 +2686,8 @@ static void LoopingRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15378), { 12, 0, height }, { { 12, 0, height }, { 3, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ThickCentred, MetalSupportPlace::TopCorner, 0, height - 8, + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::BottomCorner, direction, 0, height - 8, session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15385), { 12, 0, height }, @@ -2697,8 +2697,8 @@ static void LoopingRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15370), { 16, 0, height }, { { 16, 0, height }, { 2, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ThickAltCentred, MetalSupportPlace::RightCorner, 0, height - 8, + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::BottomCorner, direction, 0, height - 8, session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15387), { 16, 0, height }, @@ -2764,9 +2764,9 @@ static void LoopingRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15378), { 12, 0, height }, { { 12, 0, height }, { 3, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ThickCentred, MetalSupportPlace::TopCorner, 0, height - 8, - session.TrackColours); + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::BottomCorner, DirectionReverse(direction), 0, + height - 8, session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15385), { 12, 0, height }, { { 12, 0, height }, { 3, 16, 119 } }); @@ -2775,9 +2775,9 @@ static void LoopingRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15370), { 16, 0, height }, { { 16, 0, height }, { 2, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ThickAltCentred, MetalSupportPlace::RightCorner, 0, height - 8, - session.TrackColours); + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::BottomCorner, DirectionReverse(direction), 0, + height - 8, session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15387), { 16, 0, height }, { { 16, 0, height }, { 2, 16, 119 } }); @@ -2786,9 +2786,9 @@ static void LoopingRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15381), { 16, 16, height }, { { 16, 16, height }, { 2, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Thick, MetalSupportPlace::BottomCorner, 0, height - 8, - session.TrackColours); + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::BottomCorner, DirectionReverse(direction), 0, + height - 8, session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15384), { 16, 16, height }, { { 16, 16, height }, { 2, 16, 119 } }); @@ -2797,9 +2797,9 @@ static void LoopingRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(15373), { 10, 16, height }, { { 10, 16, height }, { 4, 16, 119 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ThickAlt, MetalSupportPlace::LeftCorner, 0, height - 8, - session.TrackColours); + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Thick, MetalSupportPlace::BottomCorner, DirectionReverse(direction), 0, + height - 8, session.TrackColours); PaintAddImageAsChildRotated( session, direction, session.TrackColours.WithIndex(15386), { 10, 16, height }, { { 10, 16, height }, { 4, 16, 119 } }); diff --git a/src/openrct2/paint/track/coaster/MineRide.cpp b/src/openrct2/paint/track/coaster/MineRide.cpp index 55d1e3fb2d..c38a8ee5e0 100644 --- a/src/openrct2/paint/track/coaster/MineRide.cpp +++ b/src/openrct2/paint/track/coaster/MineRide.cpp @@ -1269,15 +1269,16 @@ static void MineRideTrackSBendRight( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19469), { 0, 0, height }, { { 0, 6, height }, { 32, 26, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomRightSide, 6, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 6, height, + session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19473), { 0, 0, height }, { { 0, 6, height }, { 32, 26, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomLeftSide, 6, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 6, height, session.SupportColours); break; case 2: @@ -1321,8 +1322,8 @@ static void MineRideTrackSBendRight( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19473), { 0, 0, height }, { { 0, 6, height }, { 32, 26, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomLeftSide, 6, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction, 6, height, session.SupportColours); break; } @@ -1343,31 +1344,25 @@ static void MineRideTrackSBendRight( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19471), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19475), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19468), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19472), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); switch (direction) { case 1: @@ -1404,31 +1399,25 @@ static void MineRideTrackLeftQuarterTurn3( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19397), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19400), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19403), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19394), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -1487,31 +1476,26 @@ static void MineRideTrackLeftQuarterTurn3( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19395), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19398), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19401), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19392), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 6, height, + session.SupportColours); switch (direction) { case 2: @@ -1560,31 +1544,25 @@ static void MineRideTrackLeftQuarterTurn3Bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19416), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19412), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19415), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19406), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -1643,15 +1621,11 @@ static void MineRideTrackLeftQuarterTurn3Bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19407), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19410), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( @@ -1660,17 +1634,16 @@ static void MineRideTrackLeftQuarterTurn3Bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19417), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19404), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 6, height, + session.SupportColours); switch (direction) { case 2: @@ -1726,8 +1699,8 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19498), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( @@ -1740,8 +1713,8 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19492), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); break; } if (direction == 0 || direction == 3) @@ -1802,15 +1775,11 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19493), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19496), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( @@ -1819,17 +1788,16 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19503), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 15, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19490), { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), direction == 2 ? 15 : 12, + height, session.SupportColours); switch (direction) { case 2: @@ -1856,8 +1824,6 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19492), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( @@ -1866,24 +1832,21 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19502), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19498), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19501), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 8, height, + session.SupportColours); switch (direction) { case 0: @@ -1947,22 +1910,16 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19490), { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19493), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19496), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( @@ -1971,10 +1928,11 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19503), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 15, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, direction == 3 ? 15 : 12, height, + session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height + 8, TunnelType::SquareFlat); @@ -2000,28 +1958,23 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( switch (trackSequence) { case 0: + { switch (direction) { case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19476), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19479), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19482), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( @@ -2030,10 +1983,13 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19489), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 11, height, session.SupportColours); break; } + constexpr uint8_t _specialValues[] = { 8, 8, 9, 11 }; + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, _specialValues[direction], height, + session.SupportColours); + if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -2048,6 +2004,7 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; + } case 1: PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; @@ -2086,14 +2043,13 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; case 3: + { switch (direction) { case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19478), { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( @@ -2102,24 +2058,23 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19488), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 15, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19484), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19487), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; } + constexpr uint8_t _specialValues[] = { 12, 15, 14, 12 }; + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), _specialValues[direction], + height, session.SupportColours); + switch (direction) { case 0: @@ -2139,22 +2094,20 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; + } case 4: + { switch (direction) { case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19479), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19482), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( @@ -2163,17 +2116,17 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19489), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 11, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19476), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; } + constexpr uint8_t _specialValues[] = { 8, 9, 11, 8 }; + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), _specialValues[direction], + height, session.SupportColours); switch (direction) { case 2: @@ -2193,6 +2146,7 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; + } case 5: PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; @@ -2231,6 +2185,7 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; case 7: + { switch (direction) { case 0: @@ -2240,31 +2195,27 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19488), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 15, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19484), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19487), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19478), { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; } + constexpr uint8_t _specialValues[] = { 15, 14, 12, 12 }; + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionReverse(direction), _specialValues[direction], + height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height + 8, TunnelType::SquareFlat); @@ -2279,6 +2230,7 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; + } } } @@ -2329,31 +2281,25 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19546), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19540), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19545), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19530), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 7, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -2483,15 +2429,11 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19531), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19536), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( @@ -2500,17 +2442,16 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19547), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19526), { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 13, height, + session.SupportColours); switch (direction) { case 2: @@ -2537,8 +2478,6 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19530), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( @@ -2547,24 +2486,21 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19546), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19540), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19545), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 7, height, + session.SupportColours); switch (direction) { case 0: @@ -2698,22 +2634,16 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19526), { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19531), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19536), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( @@ -2722,10 +2652,11 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19547), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionReverse(direction), 13, height, + session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height + 8, TunnelType::SquareFlat); @@ -2757,22 +2688,16 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19504), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19509), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19514), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( @@ -2781,10 +2706,10 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19525), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 7, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -2913,8 +2838,6 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19508), { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( @@ -2923,24 +2846,21 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19524), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19518), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19523), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 13, height, + session.SupportColours); switch (direction) { case 0: @@ -2967,15 +2887,11 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19509), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19514), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( @@ -2984,17 +2900,16 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19525), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19504), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 7, height, + session.SupportColours); switch (direction) { case 2: @@ -3132,31 +3047,26 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19524), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19518), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19523), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19508), { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionReverse(direction), 13, height, + session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height + 8, TunnelType::SquareFlat); @@ -3256,31 +3166,25 @@ static void MineRideTrackLeftEighthToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19564), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19568), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19572), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19576), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -3375,33 +3279,25 @@ static void MineRideTrackLeftEighthToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19567), { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19571), { 0, 0, height }, { { 0, 16, height }, { 16, 18, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::LeftCorner, 6, height, - session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19575), { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19579), { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::RightCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3429,31 +3325,25 @@ static void MineRideTrackRightEighthToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19548), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19552), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19556), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19560), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -3548,32 +3438,25 @@ static void MineRideTrackRightEighthToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19551), { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19555), { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19559), { 0, 0, height }, { { 0, 16, height }, { 16, 18, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19563), { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3619,31 +3502,25 @@ static void MineRideTrackLeftEighthBankToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19596), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19600), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19604), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19608), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -3738,33 +3615,25 @@ static void MineRideTrackLeftEighthBankToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19599), { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19603), { 0, 0, height }, { { 0, 16, height + 27 }, { 16, 18, 0 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::LeftCorner, 6, height, - session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19607), { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19611), { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::RightCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -3792,31 +3661,25 @@ static void MineRideTrackRightEighthBankToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19580), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19584), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19588), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19592), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -3911,32 +3774,25 @@ static void MineRideTrackRightEighthBankToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19583), { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19587), { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19591), { 0, 0, height }, { { 0, 16, height + 27 }, { 16, 18, 0 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19595), { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4053,28 +3909,14 @@ static void MineRideTrackDiag25DegUp( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 14, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19625), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 14, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 14, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 14, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 14, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4154,27 +3996,14 @@ static void MineRideTrackDiagFlatTo25DegUp( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19617), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4254,28 +4083,14 @@ static void MineRideTrackDiag25DegUpToFlat( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 10, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19621), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 10, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 10, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4355,28 +4170,14 @@ static void MineRideTrackDiag25DegDown( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 14, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19627), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 14, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 14, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 14, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 14, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4453,28 +4254,14 @@ static void MineRideTrackDiagFlatTo25DegDown( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 10, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19623), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 10, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 10, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4555,27 +4342,14 @@ static void MineRideTrackDiag25DegDownToFlat( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19619), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4658,27 +4432,14 @@ static void MineRideTrackDiagFlatToLeftBank( case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19633), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4761,27 +4522,14 @@ static void MineRideTrackDiagFlatToRightBank( case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19638), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4864,27 +4612,14 @@ static void MineRideTrackDiagLeftBankToFlat( case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19640), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -4967,27 +4702,14 @@ static void MineRideTrackDiagRightBankToFlat( case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19635), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5070,27 +4792,14 @@ static void MineRideTrackDiagLeftBankTo25DegUp( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19653), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5173,27 +4882,14 @@ static void MineRideTrackDiagRightBankTo25DegUp( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19658), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5276,28 +4972,14 @@ static void MineRideTrackDiag25DegUpToLeftBank( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 10, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19643), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 10, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 10, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5380,28 +5062,14 @@ static void MineRideTrackDiag25DegUpToRightBank( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 10, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19648), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 10, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 10, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5481,28 +5149,14 @@ static void MineRideTrackDiagLeftBankTo25DegDown( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 10, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19650), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 10, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 10, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5583,28 +5237,14 @@ static void MineRideTrackDiagRightBankTo25DegDown( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 10, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19645), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 10, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 10, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5688,27 +5328,14 @@ static void MineRideTrackDiag25DegDownToLeftBank( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19660), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5791,27 +5418,14 @@ static void MineRideTrackDiag25DegDownToRightBank( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19655), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5891,27 +5505,14 @@ static void MineRideTrackDiagLeftBank( case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19629), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5991,27 +5592,14 @@ static void MineRideTrackDiagRightBank( case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19631), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( diff --git a/src/openrct2/paint/track/coaster/MiniRollerCoaster.cpp b/src/openrct2/paint/track/coaster/MiniRollerCoaster.cpp index 9800ae94b7..9a2e73626e 100644 --- a/src/openrct2/paint/track/coaster/MiniRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/MiniRollerCoaster.cpp @@ -48,41 +48,21 @@ static void MiniRCTrackFlat( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19044), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19045), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19046), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19047), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; } } @@ -95,25 +75,20 @@ static void MiniRCTrackFlat( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18738), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18739), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; } } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); + } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); @@ -166,41 +141,21 @@ static void MiniRCTrack25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19056), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19057), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19058), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19059), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; } } @@ -212,44 +167,29 @@ static void MiniRCTrack25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18796), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18797), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18798), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18799), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; } } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -273,43 +213,28 @@ static void MiniRCTrack60DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18812), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 38, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18813), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 98 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 38, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18814), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 98 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 38, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18815), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 38, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 38, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -335,41 +260,21 @@ static void MiniRCTrackFlatTo25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19048), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19049), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19050), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19051), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; } } @@ -381,44 +286,29 @@ static void MiniRCTrackFlatTo25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18788), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18789), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18790), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18791), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; } } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 9, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -442,11 +332,6 @@ static void MiniRCTrack25DegUpTo60DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18800), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 18, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( @@ -455,11 +340,6 @@ static void MiniRCTrack25DegUpTo60DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18804), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 66 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 18, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( @@ -468,23 +348,18 @@ static void MiniRCTrack25DegUpTo60DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18805), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 66 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 18, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18803), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 18, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 18, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -508,11 +383,6 @@ static void MiniRCTrack60DegUpTo25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18806), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 26, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( @@ -521,11 +391,6 @@ static void MiniRCTrack60DegUpTo25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18810), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 66 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 26, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( @@ -534,23 +399,18 @@ static void MiniRCTrack60DegUpTo25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18811), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 66 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 26, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18809), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 26, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 26, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -576,41 +436,21 @@ static void MiniRCTrack25DegUpToFlat( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19052), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19053), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19054), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19055), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; } } @@ -622,44 +462,29 @@ static void MiniRCTrack25DegUpToFlat( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18792), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18793), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18794), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18795), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; } } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 12, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareFlat); @@ -734,31 +559,25 @@ static void MiniRCTrackLeftQuarterTurn5( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18851), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18856), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18861), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18846), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -888,31 +707,26 @@ static void MiniRCTrackLeftQuarterTurn5( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18847), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18852), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18857), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18842), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 6, height, + session.SupportColours); switch (direction) { case 2: @@ -958,11 +772,6 @@ static void MiniRCTrackFlatToLeftBank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18756), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( @@ -971,33 +780,23 @@ static void MiniRCTrackFlatToLeftBank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18757), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18750), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18751), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); + } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); @@ -1014,21 +813,11 @@ static void MiniRCTrackFlatToRightBank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18752), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18753), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( @@ -1037,11 +826,6 @@ static void MiniRCTrackFlatToRightBank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18758), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( @@ -1050,13 +834,13 @@ static void MiniRCTrackFlatToRightBank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18759), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); + } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); @@ -1076,11 +860,6 @@ static void MiniRCTrackLeftBankToFlat( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18758), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( @@ -1089,33 +868,23 @@ static void MiniRCTrackLeftBankToFlat( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18759), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18752), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18753), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); + } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); @@ -1132,21 +901,11 @@ static void MiniRCTrackRightBankToFlat( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18750), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18751), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( @@ -1155,11 +914,6 @@ static void MiniRCTrackRightBankToFlat( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18756), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( @@ -1168,13 +922,14 @@ static void MiniRCTrackRightBankToFlat( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18757), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; } + + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); + } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); @@ -1197,31 +952,25 @@ static void MiniRCTrackBankedLeftQuarterTurn5( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18882), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18876), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18881), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18866), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -1351,15 +1100,11 @@ static void MiniRCTrackBankedLeftQuarterTurn5( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18867), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18872), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( @@ -1368,17 +1113,16 @@ static void MiniRCTrackBankedLeftQuarterTurn5( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18883), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18862), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 6, height, + session.SupportColours); switch (direction) { case 2: @@ -1424,11 +1168,6 @@ static void MiniRCTrackLeftBankTo25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18764), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( @@ -1437,33 +1176,23 @@ static void MiniRCTrackLeftBankTo25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18765), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18762), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18763), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 9, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -1487,21 +1216,11 @@ static void MiniRCTrackRightBankTo25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18766), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18767), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( @@ -1510,11 +1229,6 @@ static void MiniRCTrackRightBankTo25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18770), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( @@ -1523,13 +1237,13 @@ static void MiniRCTrackRightBankTo25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18771), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 9, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -1556,11 +1270,6 @@ static void MiniRCTrack25DegUpToLeftBank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18776), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( @@ -1569,33 +1278,23 @@ static void MiniRCTrack25DegUpToLeftBank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18777), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18774), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18775), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 12, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareFlat); @@ -1619,21 +1318,11 @@ static void MiniRCTrack25DegUpToRightBank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18778), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18779), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( @@ -1642,11 +1331,6 @@ static void MiniRCTrack25DegUpToRightBank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18782), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( @@ -1655,13 +1339,13 @@ static void MiniRCTrack25DegUpToRightBank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18783), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 12, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareFlat); @@ -1717,43 +1401,28 @@ static void MiniRCTrackLeftBank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18784), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18785), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18786), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18787), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); + } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); @@ -1781,31 +1450,25 @@ static void MiniRCTrackLeftQuarterTurn525DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18936), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18941), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18946), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18951), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -1930,31 +1593,26 @@ static void MiniRCTrackLeftQuarterTurn525DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18940), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18945), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18950), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18955), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 14, height, + session.SupportColours); switch (direction) { case 2: @@ -1991,31 +1649,25 @@ static void MiniRCTrackRightQuarterTurn525DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18916), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18921), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18926), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18931), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -2139,31 +1791,25 @@ static void MiniRCTrackRightQuarterTurn525DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18920), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18925), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18930), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18935), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); switch (direction) { case 0: @@ -2218,31 +1864,25 @@ static void MiniRCTrackSBendLeft( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18900), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18904), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18903), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18907), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -2263,14 +1903,15 @@ static void MiniRCTrackSBendLeft( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18901), { 0, 0, height }, { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopLeftSide, 3, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction, 3, height, + session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18905), { 0, 0, height }, { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopRightSide, 6, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction, 6, height, session.SupportColours); break; case 2: @@ -2316,8 +1957,8 @@ static void MiniRCTrackSBendLeft( case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18905), { 0, 0, height }, { 32, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopRightSide, 6, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 6, height, session.SupportColours); break; } @@ -2338,31 +1979,25 @@ static void MiniRCTrackSBendLeft( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18903), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18907), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18900), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18904), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); switch (direction) { case 1: @@ -2399,31 +2034,25 @@ static void MiniRCTrackSBendRight( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18908), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18912), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18911), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18915), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -2452,8 +2081,8 @@ static void MiniRCTrackSBendRight( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18913), { 0, 0, height }, { { 0, 6, height }, { 32, 26, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomLeftSide, 6, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 6, height, session.SupportColours); break; case 2: @@ -2497,8 +2126,8 @@ static void MiniRCTrackSBendRight( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18913), { 0, 0, height }, { { 0, 6, height }, { 32, 26, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomLeftSide, 6, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 6, height, session.SupportColours); break; } @@ -2519,31 +2148,25 @@ static void MiniRCTrackSBendRight( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18911), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18915), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18908), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18912), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); switch (direction) { case 1: @@ -2580,31 +2203,25 @@ static void MiniRCTrackLeftQuarterTurn3( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18821), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18824), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18827), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18818), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -2663,31 +2280,26 @@ static void MiniRCTrackLeftQuarterTurn3( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18819), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18822), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18825), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18816), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 6, height, + session.SupportColours); switch (direction) { case 2: @@ -2736,31 +2348,25 @@ static void MiniRCTrackLeftQuarterTurn3Bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18840), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18836), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18839), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18830), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -2819,15 +2425,11 @@ static void MiniRCTrackLeftQuarterTurn3Bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18831), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18834), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( @@ -2836,17 +2438,16 @@ static void MiniRCTrackLeftQuarterTurn3Bank( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18841), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18828), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 6, height, + session.SupportColours); switch (direction) { case 2: @@ -2891,28 +2492,22 @@ static void MiniRCTrackLeftQuarterTurn325DegUp( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18967), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18969), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18971), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18965), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -2939,28 +2534,23 @@ static void MiniRCTrackLeftQuarterTurn325DegUp( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18966), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18968), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18970), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18964), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 14, height, + session.SupportColours); switch (direction) { case 2: @@ -2996,28 +2586,22 @@ static void MiniRCTrackRightQuarterTurn325DegUp( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18956), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18958), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18960), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18962), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -3044,28 +2628,23 @@ static void MiniRCTrackRightQuarterTurn325DegUp( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18957), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18959), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18961), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 16, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18963), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 14, height, + session.SupportColours); switch (direction) { case 0: @@ -3123,31 +2702,25 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18998), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18994), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18997), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18988), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -3206,15 +2779,11 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18989), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18992), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( @@ -3223,17 +2792,16 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18999), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 15, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18986), { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, (direction == 2) ? 15 : 12, height, + session.SupportColours); switch (direction) { case 2: @@ -3260,8 +2828,6 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18988), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( @@ -3270,24 +2836,21 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18998), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18994), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18997), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 8, height, + session.SupportColours); switch (direction) { case 0: @@ -3351,22 +2914,16 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18986), { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18989), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18992), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( @@ -3375,10 +2932,11 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18999), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 15, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionReverse(direction), (direction == 3) ? 15 : 12, + height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height + 8, TunnelType::SquareFlat); @@ -3410,22 +2968,16 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18972), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18975), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18978), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( @@ -3434,10 +2986,10 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18985), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 11, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -3490,14 +3042,13 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; case 3: + { switch (direction) { case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18974), { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( @@ -3506,24 +3057,22 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18984), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 15, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18980), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18983), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; } + constexpr uint8_t _specialValues[] = { 12, 15, 14, 12 }; + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), _specialValues[direction], + height, session.SupportColours); switch (direction) { case 0: @@ -3543,22 +3092,20 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; + } case 4: + { switch (direction) { case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18975), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18978), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( @@ -3567,17 +3114,17 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18985), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 11, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18972), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; } + constexpr uint8_t _specialValues[] = { 8, 9, 11, 8 }; + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), _specialValues[direction], + height, session.SupportColours); switch (direction) { case 2: @@ -3597,6 +3144,7 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; + } case 5: PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; @@ -3635,6 +3183,7 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; case 7: + { switch (direction) { case 0: @@ -3644,31 +3193,27 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18984), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 15, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18980), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18983), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18974), { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); break; } + constexpr uint8_t _specialValues[] = { 15, 14, 12, 12 }; + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionReverse(direction), _specialValues[direction], + height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height + 8, TunnelType::SquareFlat); @@ -3683,6 +3228,7 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; + } } } @@ -3732,31 +3278,25 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19042), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19036), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19041), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19026), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 7, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -3886,15 +3426,11 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19027), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19032), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( @@ -3903,17 +3439,16 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19043), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19022), { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 13, height, + session.SupportColours); switch (direction) { case 2: @@ -3940,8 +3475,6 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19026), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( @@ -3950,24 +3483,21 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19042), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19036), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19041), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 7, height, + session.SupportColours); switch (direction) { case 0: @@ -4101,22 +3631,16 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19022), { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19027), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19032), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( @@ -4125,10 +3649,11 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19043), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionReverse(direction), 13, height, + session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height + 8, TunnelType::SquareFlat); @@ -4160,22 +3685,16 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19000), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19005), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19010), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( @@ -4184,10 +3703,10 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19021), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 7, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -4316,8 +3835,6 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19004), { 0, 0, height }, { { 6, 0, height + 8 }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( @@ -4326,24 +3843,21 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19020), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19014), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19019), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 13, height, + session.SupportColours); switch (direction) { case 0: @@ -4370,15 +3884,11 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19005), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19010), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( @@ -4387,17 +3897,16 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19021), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19000), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 7, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 7, height, + session.SupportColours); switch (direction) { case 2: @@ -4535,31 +4044,26 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19020), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19014), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19019), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19004), { 0, 0, height }, { { 0, 6, height + 8 }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 13, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionReverse(direction), 13, height, + session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height + 8, TunnelType::SquareFlat); @@ -4726,24 +4230,19 @@ static void MiniRCTrackBrakes( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18740), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(18741), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); + } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); @@ -4760,43 +4259,28 @@ static void MiniRCTrack25DegUpLeftBanked( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19222), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19223), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19224), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19225), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -4820,43 +4304,28 @@ static void MiniRCTrack25DegUpRightBanked( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19226), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19227), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19228), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19229), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -4937,31 +4406,25 @@ static void MiniRCTrackLeftEighthToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19076), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19080), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19084), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19088), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -5056,33 +4519,25 @@ static void MiniRCTrackLeftEighthToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19079), { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19083), { 0, 0, height }, { { 0, 16, height }, { 16, 18, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::LeftCorner, 6, height, - session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19087), { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19091), { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::RightCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5110,31 +4565,25 @@ static void MiniRCTrackRightEighthToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19060), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19064), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19068), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19072), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -5229,32 +4678,25 @@ static void MiniRCTrackRightEighthToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19063), { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19067), { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19071), { 0, 0, height }, { { 0, 16, height }, { 16, 18, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19075), { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5300,31 +4742,25 @@ static void MiniRCTrackLeftEighthBankToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19108), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19112), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19116), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19120), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -5419,33 +4855,25 @@ static void MiniRCTrackLeftEighthBankToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19111), { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomCorner, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19115), { 0, 0, height }, { { 0, 16, height + 27 }, { 16, 18, 0 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::LeftCorner, 6, height, - session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19119), { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19123), { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::RightCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5473,31 +4901,25 @@ static void MiniRCTrackRightEighthBankToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19092), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19096), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19100), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19104), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 26 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -5592,32 +5014,25 @@ static void MiniRCTrackRightEighthBankToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19095), { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19099), { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19103), { 0, 0, height }, { { 0, 16, height + 27 }, { 16, 18, 0 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19107), { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5782,26 +5197,10 @@ static void MiniRCTrackDiag25DegUp( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 14, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19199), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 14, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 14, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 14, height, - session.SupportColours); break; } } @@ -5809,29 +5208,15 @@ static void MiniRCTrackDiag25DegUp( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 14, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19137), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 14, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 14, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 14, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 14, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -5911,28 +5296,15 @@ static void MiniRCTrackDiag60DegUp( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 38, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19149), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 42, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 38, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 42, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, (direction & 1) ? 42 : 38, direction, height, + session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -6056,26 +5428,10 @@ static void MiniRCTrackDiagFlatTo25DegUp( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19191), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } @@ -6083,29 +5439,15 @@ static void MiniRCTrackDiagFlatTo25DegUp( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19129), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -6185,28 +5527,14 @@ static void MiniRCTrackDiag25DegUpTo60DegUp( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 22, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19141), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 22, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 22, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 22, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 22, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -6286,28 +5614,14 @@ static void MiniRCTrackDiag60DegUpTo25DegUp( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 27, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19145), { -16, -16, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 27, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 27, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 27, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 27, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -6431,26 +5745,10 @@ static void MiniRCTrackDiag25DegUpToFlat( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 10, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19195), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 10, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 10, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } } @@ -6458,29 +5756,15 @@ static void MiniRCTrackDiag25DegUpToFlat( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 10, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19133), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 10, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 10, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -6604,26 +5888,10 @@ static void MiniRCTrackDiag25DegDown( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 14, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19201), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 14, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 14, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 14, height, - session.SupportColours); break; } } @@ -6631,29 +5899,15 @@ static void MiniRCTrackDiag25DegDown( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 14, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19139), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 14, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 14, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 14, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 14, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -6733,28 +5987,15 @@ static void MiniRCTrackDiag60DegDown( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 30, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19151), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 34, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 30, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 34, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, (direction & 1) ? 34 : 30, height, + session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -6875,26 +6116,10 @@ static void MiniRCTrackDiagFlatTo25DegDown( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 10, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19197), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 10, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 10, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } } @@ -6902,29 +6127,15 @@ static void MiniRCTrackDiagFlatTo25DegDown( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 10, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19135), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 10, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 10, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7005,28 +6216,14 @@ static void MiniRCTrackDiag25DegDownTo60DegDown( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 23, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19147), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 23, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 23, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 23, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 23, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7106,28 +6303,14 @@ static void MiniRCTrackDiag60DegDownTo25DegDown( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 14, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19143), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 14, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 14, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 14, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 14, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7251,26 +6434,10 @@ static void MiniRCTrackDiag25DegDownToFlat( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19193), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } @@ -7278,29 +6445,15 @@ static void MiniRCTrackDiag25DegDownToFlat( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19131), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7383,27 +6536,14 @@ static void MiniRCTrackDiagFlatToLeftBank( case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19157), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7486,27 +6626,14 @@ static void MiniRCTrackDiagFlatToRightBank( case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19162), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7589,27 +6716,14 @@ static void MiniRCTrackDiagLeftBankToFlat( case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19164), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7692,27 +6806,14 @@ static void MiniRCTrackDiagRightBankToFlat( case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19159), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7795,27 +6896,14 @@ static void MiniRCTrackDiagLeftBankTo25DegUp( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19177), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -7898,27 +6986,14 @@ static void MiniRCTrackDiagRightBankTo25DegUp( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19182), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8001,28 +7076,14 @@ static void MiniRCTrackDiag25DegUpToLeftBank( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 10, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19167), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 10, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 10, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8105,28 +7166,14 @@ static void MiniRCTrackDiag25DegUpToRightBank( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 10, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19172), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 10, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 10, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8206,28 +7253,14 @@ static void MiniRCTrackDiagLeftBankTo25DegDown( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 10, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19174), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 10, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 10, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8308,28 +7341,14 @@ static void MiniRCTrackDiagRightBankTo25DegDown( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 10, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19169), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 10, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 10, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 10, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 10, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8413,27 +7432,14 @@ static void MiniRCTrackDiag25DegDownToLeftBank( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19184), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8516,27 +7522,14 @@ static void MiniRCTrackDiag25DegDownToRightBank( case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19179), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8616,27 +7609,14 @@ static void MiniRCTrackDiagLeftBank( case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19153), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8716,27 +7696,14 @@ static void MiniRCTrackDiagRightBank( case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19155), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 6, height, session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -8759,24 +7726,10 @@ static void MiniRCTrackBlockBrakes( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(_MiniRCBlockBrakeImages[direction][isClosed]), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - switch (direction) + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - case 0: - case 2: - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } - break; - case 1: - case 3: - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } - break; + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); @@ -8796,29 +7749,23 @@ static void MiniRCTrackLeftBankedQuarterTurn325DegUp( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19317), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19319), { 0, 6, height }, { { 0, 27, height }, { 32, 1, 34 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19321), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19315), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -8845,30 +7792,25 @@ static void MiniRCTrackLeftBankedQuarterTurn325DegUp( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19316), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19318), { 6, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19320), { 6, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19314), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 14, height, + session.SupportColours); switch (direction) { case 2: @@ -8904,29 +7846,23 @@ static void MiniRCTrackRightBankedQuarterTurn325DegUp( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19306), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19308), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19310), { 0, 6, height }, { { 0, 27, height }, { 32, 1, 34 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19312), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -8953,30 +7889,25 @@ static void MiniRCTrackRightBankedQuarterTurn325DegUp( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19307), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19309), { 6, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19311), { 6, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 16, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19313), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 14, height, + session.SupportColours); switch (direction) { case 0: @@ -9033,31 +7964,25 @@ static void MiniRCTrackLeftBankedQuarterTurn525DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19286), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19291), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19296), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19301), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -9185,31 +8110,26 @@ static void MiniRCTrackLeftBankedQuarterTurn525DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19290), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19295), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19300), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19305), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 14, height, + session.SupportColours); switch (direction) { case 2: @@ -9246,31 +8166,25 @@ static void MiniRCTrackRightBankedQuarterTurn525DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19266), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19271), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19276), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19281), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -9397,31 +8311,26 @@ static void MiniRCTrackRightBankedQuarterTurn525DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19270), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19275), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19280), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19285), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 14, height, + session.SupportColours); switch (direction) { case 0: @@ -9475,11 +8384,6 @@ static void MiniRCTrack25DegUpToLeftBanked25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19230), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( @@ -9488,33 +8392,23 @@ static void MiniRCTrack25DegUpToLeftBanked25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19238), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19232), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19233), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -9538,21 +8432,11 @@ static void MiniRCTrack25DegUpToRightBanked25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19234), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19235), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( @@ -9561,23 +8445,18 @@ static void MiniRCTrack25DegUpToRightBanked25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19239), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19237), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -9601,11 +8480,6 @@ static void MiniRCTrackLeftBanked25DegUpTo25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19240), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( @@ -9614,33 +8488,23 @@ static void MiniRCTrackLeftBanked25DegUpTo25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19248), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19242), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19243), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -9664,21 +8528,11 @@ static void MiniRCTrackRightBanked25DegUpTo25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19244), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19245), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( @@ -9687,23 +8541,18 @@ static void MiniRCTrackRightBanked25DegUpTo25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19249), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19247), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -9761,43 +8610,28 @@ static void MiniRCTrackLeftBankedFlatToLeftBanked25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19250), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19251), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19252), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19253), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 9, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -9821,43 +8655,28 @@ static void MiniRCTrackRightBankedFlatToRightBanked25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19254), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19255), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19256), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19257), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 9, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -9881,43 +8700,28 @@ static void MiniRCTrackLeftBanked25DegUpToLeftBankedFlat( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19258), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19259), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19260), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19261), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 12, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareFlat); @@ -9941,43 +8745,28 @@ static void MiniRCTrackRightBanked25DegUpToRightBankedFlat( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19262), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19263), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19264), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19265), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 12, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareFlat); @@ -10037,11 +8826,6 @@ static void MiniRCTrackFlatToLeftBanked25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19202), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( @@ -10050,33 +8834,23 @@ static void MiniRCTrackFlatToLeftBanked25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19210), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19204), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19205), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 9, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -10100,21 +8874,11 @@ static void MiniRCTrackFlatToRightBanked25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19206), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19207), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( @@ -10123,23 +8887,18 @@ static void MiniRCTrackFlatToRightBanked25DegUp( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19211), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19209), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 9, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 9, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -10163,11 +8922,6 @@ static void MiniRCTrackLeftBanked25DegUpToFlat( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19212), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( @@ -10176,33 +8930,23 @@ static void MiniRCTrackLeftBanked25DegUpToFlat( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19220), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19214), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19215), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 12, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareFlat); @@ -10226,21 +8970,11 @@ static void MiniRCTrackRightBanked25DegUpToFlat( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19216), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19217), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 2: PaintAddImageAsParentRotated( @@ -10249,23 +8983,18 @@ static void MiniRCTrackRightBanked25DegUpToFlat( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19221), { 0, 0, height }, { { 0, 27, height }, { 32, 1, 34 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19219), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 12, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 12, height, session.SupportColours); + } if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareFlat); @@ -10322,28 +9051,22 @@ static void MiniRCTrackLeftCurvedLiftHill( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19333), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19335), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19337), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19331), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -10370,28 +9093,23 @@ static void MiniRCTrackLeftCurvedLiftHill( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19332), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 17, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19334), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 17, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19336), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 17, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19330), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 17, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 17, height, + session.SupportColours); switch (direction) { case 2: @@ -10426,28 +9144,22 @@ static void MiniRCTrackRightCurvedLiftHill( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19322), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19324), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19326), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19328), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 14, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 14, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); @@ -10474,28 +9186,23 @@ static void MiniRCTrackRightCurvedLiftHill( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19323), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 17, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19325), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 17, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19327), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 17, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(19329), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 17, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionNext(direction), 17, height, + session.SupportColours); switch (direction) { case 0: @@ -10529,24 +9236,19 @@ static void MiniRCTrackBooster( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(SPR_G2_MINI_RC_BOOSTER_NE_SW), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(SPR_G2_MINI_RC_BOOSTER_NW_SE), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); - } break; } + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 6, height, session.SupportColours); + } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::SquareFlat); PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); diff --git a/src/openrct2/paint/track/coaster/MiniSuspendedCoaster.cpp b/src/openrct2/paint/track/coaster/MiniSuspendedCoaster.cpp index 41b1e02a22..06cf08dba4 100644 --- a/src/openrct2/paint/track/coaster/MiniSuspendedCoaster.cpp +++ b/src/openrct2/paint/track/coaster/MiniSuspendedCoaster.cpp @@ -69,19 +69,8 @@ static void MiniSuspendedRCTrackFlat( PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - switch (direction) - { - case 0: - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); - break; - case 1: - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height + 30, session.SupportColours); } PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -176,27 +165,8 @@ static void MiniSuspendedRCTrack25DegUp( PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopRightSide, 0, height + 46, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomRightSide, 0, height + 46, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomLeftSide, 0, height + 46, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopLeftSide, 0, height + 46, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopRightSide, direction, 0, height + 46, session.SupportColours); } if (direction == 0 || direction == 3) @@ -271,27 +241,8 @@ static void MiniSuspendedRCTrackFlatTo25DegUp( PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopRightSide, 0, height + 38, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomRightSide, 0, height + 38, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomLeftSide, 0, height + 38, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopLeftSide, 0, height + 38, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopRightSide, direction, 0, height + 38, session.SupportColours); } if (direction == 0 || direction == 3) @@ -366,27 +317,8 @@ static void MiniSuspendedRCTrack25DegUpToFlat( PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopRightSide, 0, height + 38, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomRightSide, 0, height + 38, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomLeftSide, 0, height + 38, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopLeftSide, 0, height + 38, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopRightSide, direction, 0, height + 38, session.SupportColours); } if (direction == 0 || direction == 3) @@ -460,20 +392,8 @@ static void MiniSuspendedRCTrackLeftQuarterTurn5( PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); - break; - case 1: - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 0, height + 30, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height + 30, session.SupportColours); if (direction == 0 || direction == 3) { @@ -606,20 +526,9 @@ static void MiniSuspendedRCTrackLeftQuarterTurn5( PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - case 2: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 0, height + 30, - session.SupportColours); - break; - case 1: - case 3: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 0, height + 30, + session.SupportColours); switch (direction) { @@ -680,20 +589,8 @@ static void MiniSuspendedRCTrackSBendLeft( PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); - break; - case 1: - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 0, height + 30, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height + 30, session.SupportColours); if (direction == 0 || direction == 3) { @@ -733,12 +630,9 @@ static void MiniSuspendedRCTrackSBendLeft( switch (direction) { case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopLeftSide, 0, height + 30, session.SupportColours); - break; case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopRightSide, 0, height + 30, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction, 0, height + 30, session.SupportColours); break; } @@ -777,12 +671,9 @@ static void MiniSuspendedRCTrackSBendLeft( switch (direction) { case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopLeftSide, 0, height + 30, session.SupportColours); - break; case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopRightSide, 0, height + 30, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 0, height + 30, session.SupportColours); break; } @@ -818,20 +709,8 @@ static void MiniSuspendedRCTrackSBendLeft( PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); - break; - case 1: - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 0, height + 30, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height + 30, session.SupportColours); switch (direction) { @@ -883,20 +762,8 @@ static void MiniSuspendedRCTrackSBendRight( PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); - break; - case 1: - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 0, height + 30, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height + 30, session.SupportColours); if (direction == 0 || direction == 3) { @@ -936,12 +803,9 @@ static void MiniSuspendedRCTrackSBendRight( switch (direction) { case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomRightSide, 0, height + 30, session.SupportColours); - break; case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomLeftSide, 0, height + 30, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 0, height + 30, session.SupportColours); break; } @@ -980,12 +844,9 @@ static void MiniSuspendedRCTrackSBendRight( switch (direction) { case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomRightSide, 0, height + 30, session.SupportColours); - break; case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomLeftSide, 0, height + 30, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction, 0, height + 30, session.SupportColours); break; } @@ -1021,20 +882,8 @@ static void MiniSuspendedRCTrackSBendRight( PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); - break; - case 1: - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 0, height + 30, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height + 30, session.SupportColours); switch (direction) { @@ -1086,20 +935,8 @@ static void MiniSuspendedRCTrackLeftQuarterTurn3( PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); - break; - case 1: - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 0, height + 30, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height + 30, session.SupportColours); if (direction == 0 || direction == 3) { @@ -1169,20 +1006,9 @@ static void MiniSuspendedRCTrackLeftQuarterTurn3( PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - case 2: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 0, height + 30, - session.SupportColours); - break; - case 1: - case 3: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 0, height + 30, + session.SupportColours); switch (direction) { @@ -1247,20 +1073,8 @@ static void MiniSuspendedRCTrackLeftEighthToDiag( PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); - break; - case 1: - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 0, height + 30, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height + 30, session.SupportColours); if (direction == 0 || direction == 3) { @@ -1380,27 +1194,8 @@ static void MiniSuspendedRCTrackLeftEighthToDiag( PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomCorner, 0, height + 30, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::LeftCorner, 0, height + 30, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopCorner, 0, height + 30, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::RightCorner, 0, height + 30, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomCorner, direction, 0, height + 30, session.SupportColours); PaintUtilSetGeneralSupportHeight(session, height + 48); break; @@ -1447,20 +1242,8 @@ static void MiniSuspendedRCTrackRightEighthToDiag( PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); - break; - case 1: - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::Centre, 0, height + 30, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height + 30, session.SupportColours); if (direction == 0 || direction == 3) { @@ -1580,27 +1363,8 @@ static void MiniSuspendedRCTrackRightEighthToDiag( PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height + 30, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height + 30, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height + 30, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height + 30, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height + 30, session.SupportColours); PaintUtilSetGeneralSupportHeight(session, height + 48); break; @@ -1781,27 +1545,8 @@ static void MiniSuspendedRCTrackDiag25DegUp( PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height + 42, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height + 42, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height + 42, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height + 42, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height + 42, session.SupportColours); PaintUtilSetGeneralSupportHeight(session, height + 72); break; @@ -1945,27 +1690,8 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegUp( PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height + 34, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height + 34, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height + 34, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height + 34, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height + 34, session.SupportColours); PaintUtilSetGeneralSupportHeight(session, height + 64); break; @@ -2109,27 +1835,8 @@ static void MiniSuspendedRCTrackDiag25DegUpToFlat( PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height + 36, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height + 36, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height + 36, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height + 36, - session.SupportColours); - break; - } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height + 36, session.SupportColours); PaintUtilSetGeneralSupportHeight(session, height + 72); break; @@ -2273,27 +1980,8 @@ static void MiniSuspendedRCTrackDiag25DegDown( PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height + 42, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height + 42, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height + 42, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height + 42, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height + 42, session.SupportColours); PaintUtilSetGeneralSupportHeight(session, height + 72); break; @@ -2434,27 +2122,8 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegDown( PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height + 36, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height + 36, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height + 36, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height + 36, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height + 36, session.SupportColours); break; } @@ -2598,27 +2267,8 @@ static void MiniSuspendedRCTrackDiag25DegDownToFlat( PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); - switch (direction) - { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height + 34, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::TopCorner, 0, height + 34, - session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height + 34, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::ForkAlt, MetalSupportPlace::BottomCorner, 0, height + 34, - session.SupportColours); - break; - } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height + 34, session.SupportColours); PaintUtilSetGeneralSupportHeight(session, height + 64); break; diff --git a/src/openrct2/paint/track/coaster/Steeplechase.cpp b/src/openrct2/paint/track/coaster/Steeplechase.cpp index ee24d4d73a..0e3d0e5d48 100644 --- a/src/openrct2/paint/track/coaster/Steeplechase.cpp +++ b/src/openrct2/paint/track/coaster/Steeplechase.cpp @@ -43,15 +43,11 @@ static void SteeplechaseTrackFlat( case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28635), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28636), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; } } @@ -63,18 +59,16 @@ static void SteeplechaseTrackFlat( case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28633), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28634), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; } } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); @@ -116,26 +110,18 @@ static void SteeplechaseTrack25DegUp( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28649), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28655), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28651), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28656), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; } } @@ -146,29 +132,23 @@ static void SteeplechaseTrack25DegUp( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28637), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28643), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28639), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28644), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 8, height, session.SupportColours); break; } } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 8, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::StandardSlopeStart); @@ -193,26 +173,18 @@ static void SteeplechaseTrackFlatTo25DegUp( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28650), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 3, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28657), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 2, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28652), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 2, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28658), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 2, height, session.SupportColours); break; } } @@ -223,29 +195,24 @@ static void SteeplechaseTrackFlatTo25DegUp( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28638), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 3, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28645), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 2, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28640), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 2, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28646), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 2, height, session.SupportColours); break; } } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, direction == 0 ? 3 : 2, height, + session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -270,26 +237,18 @@ static void SteeplechaseTrack25DegUpToFlat( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28654), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28660), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28653), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 5, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28659), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 5, height, session.SupportColours); break; } } @@ -300,29 +259,24 @@ static void SteeplechaseTrack25DegUpToFlat( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28642), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28648), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 6, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28641), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 5, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28647), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 5, height, session.SupportColours); break; } } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, direction <= 1 ? 6 : 5, height, + session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::StandardFlat); @@ -378,8 +332,8 @@ static void SteeplechaseTrackLeftQuarterTurn5( case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28703), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 1, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 1, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( @@ -390,8 +344,8 @@ static void SteeplechaseTrackLeftQuarterTurn5( case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28693), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height - 1, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height - 1, session.SupportColours); break; } @@ -511,8 +465,8 @@ static void SteeplechaseTrackLeftQuarterTurn5( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28694), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height - 3, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 0, height - 3, session.SupportColours); break; case 1: @@ -524,8 +478,9 @@ static void SteeplechaseTrackLeftQuarterTurn5( case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28704), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 1, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), 1, height, + session.SupportColours); break; case 3: PaintAddImageAsParentRotated( @@ -573,34 +528,30 @@ static void SteeplechaseTrackSBendLeft( switch (trackSequence) { case 0: + { switch (direction) { case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28665), { 0, 6, height }, { 33, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28672), { 0, 6, height }, { 33, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28668), { 0, 6, height }, { 33, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28669), { 0, 6, height }, { 33, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height - 2, - session.SupportColours); break; } + auto heightOffset = (direction == 3) ? 2 : 0; + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, 0, direction, height - heightOffset, + session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -615,6 +566,7 @@ static void SteeplechaseTrackSBendLeft( 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; + } case 1: switch (direction) { @@ -627,8 +579,8 @@ static void SteeplechaseTrackSBendLeft( case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28671), { 0, 0, height }, { 33, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::TopRightSide, 0, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction, 0, height, session.SupportColours); break; case 2: @@ -670,8 +622,8 @@ static void SteeplechaseTrackSBendLeft( case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28671), { 0, 0, height }, { 33, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::TopRightSide, 0, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 0, height, session.SupportColours); break; } @@ -691,29 +643,23 @@ static void SteeplechaseTrackSBendLeft( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28668), { 0, 6, height }, { 33, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28669), { 0, 6, height }, { 33, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height - 2, - session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28665), { 0, 6, height }, { 33, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28672), { 0, 6, height }, { 33, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height - ((direction == 1) ? 2 : 0), + session.SupportColours); switch (direction) { case 1: @@ -749,28 +695,22 @@ static void SteeplechaseTrackSBendRight( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28661), { 0, 6, height }, { 33, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28676), { 0, 6, height }, { 33, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28664), { 0, 6, height }, { 33, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28673), { 0, 6, height }, { 33, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -797,8 +737,8 @@ static void SteeplechaseTrackSBendRight( case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28675), { 0, 6, height }, { 33, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::BottomLeftSide, 0, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction, 0, height, session.SupportColours); break; case 2: @@ -840,8 +780,8 @@ static void SteeplechaseTrackSBendRight( case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28675), { 0, 6, height }, { 33, 26, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::BottomLeftSide, 0, height, + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction, 0, height, session.SupportColours); break; } @@ -861,28 +801,22 @@ static void SteeplechaseTrackSBendRight( case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28664), { 0, 6, height }, { 33, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28673), { 0, 6, height }, { 33, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28661), { 0, 6, height }, { 33, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28676), { 0, 6, height }, { 33, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); switch (direction) { case 1: @@ -913,34 +847,31 @@ static void SteeplechaseTrackLeftQuarterTurn3( switch (trackSequence) { case 0: + { switch (direction) { case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28682), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 3, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28685), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 1, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28688), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28679), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height - 3, - session.SupportColours); break; } + constexpr uint8_t _specialValues[] = { 3, 1, 0, 0 }; + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, _specialValues[direction], height, + session.SupportColours); + if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -955,6 +886,7 @@ static void SteeplechaseTrackLeftQuarterTurn3( 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; + } case 1: PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; @@ -989,33 +921,32 @@ static void SteeplechaseTrackLeftQuarterTurn3( PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; case 3: + { switch (direction) { case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28680), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28683), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 1, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28686), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 3, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28677), { 6, 0, height }, { 20, 32, 3 }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height - 3, session.SupportColours); break; } + constexpr uint8_t _specialValues[] = { 0, 1, 3, 0 }; + constexpr int8_t _heightOffsets[] = { 0, 0, 0, -3 }; + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, DirectionPrev(direction), _specialValues[direction], + height + _heightOffsets[direction], session.SupportColours); + switch (direction) { case 2: @@ -1035,6 +966,7 @@ static void SteeplechaseTrackLeftQuarterTurn3( 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); break; + } } } @@ -1058,16 +990,16 @@ static void SteeplechaseTrackBrakes( case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28635), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28636), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); + PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); @@ -1087,31 +1019,25 @@ static void SteeplechaseTrackLeftEighthToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28725), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28729), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28733), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28737), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -1206,33 +1132,25 @@ static void SteeplechaseTrackLeftEighthToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28728), { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomCorner, 0, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28732), { 0, 0, height }, { { 0, 16, height }, { 16, 18, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::LeftCorner, 0, height, - session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28736), { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopCorner, 0, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28740), { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::RightCorner, 0, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1260,31 +1178,25 @@ static void SteeplechaseTrackRightEighthToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28709), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28713), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28717), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28721), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); @@ -1379,33 +1291,25 @@ static void SteeplechaseTrackRightEighthToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28712), { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28716), { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28720), { 0, 0, height }, { { 0, 16, height }, { 16, 18, 3 } }); - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28724), { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1579,26 +1483,10 @@ static void SteeplechaseTrackDiag25DegUp( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28770), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::TopCorner, 6, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } @@ -1606,29 +1494,15 @@ static void SteeplechaseTrackDiag25DegUp( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28754), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::TopCorner, 6, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1752,26 +1626,10 @@ static void SteeplechaseTrackDiagFlatTo25DegUp( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28762), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } } @@ -1779,29 +1637,15 @@ static void SteeplechaseTrackDiagFlatTo25DegUp( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28746), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1925,26 +1769,10 @@ static void SteeplechaseTrackDiag25DegUpToFlat( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 4, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28766), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::TopCorner, 4, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 4, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } } @@ -1952,29 +1780,15 @@ static void SteeplechaseTrackDiag25DegUpToFlat( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 4, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28750), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::TopCorner, 4, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 4, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2098,26 +1912,10 @@ static void SteeplechaseTrackDiag25DegDown( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28772), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::TopCorner, 6, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } @@ -2125,29 +1923,15 @@ static void SteeplechaseTrackDiag25DegDown( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 6, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28756), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::TopCorner, 6, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 6, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::BottomCorner, 6, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2268,26 +2052,10 @@ static void SteeplechaseTrackDiagFlatTo25DegDown( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 4, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28768), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::TopCorner, 4, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 4, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } } @@ -2295,29 +2063,15 @@ static void SteeplechaseTrackDiagFlatTo25DegDown( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 4, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28752), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::TopCorner, 4, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 4, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::BottomCorner, 4, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2442,26 +2196,10 @@ static void SteeplechaseTrackDiag25DegDownToFlat( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28764), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } } @@ -2469,29 +2207,15 @@ static void SteeplechaseTrackDiag25DegDownToFlat( { switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28748), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::TopCorner, 0, height, - session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::BottomCorner, 0, height, - session.SupportColours); break; } } + MetalBSupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -2516,16 +2240,15 @@ static void SteeplechaseTrackBlockBrakes( case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28635), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup(session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; case 1: case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(28636), { 0, 6, height }, { 32, 20, 3 }); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TunnelType::StandardFlat); PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(BlockedSegments::kStraightFlat, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + kDefaultGeneralSupportHeight); diff --git a/src/openrct2/paint/track/coaster/WoodenRollerCoaster.cpp b/src/openrct2/paint/track/coaster/WoodenRollerCoaster.cpp index 839482da25..c25cc1c415 100644 --- a/src/openrct2/paint/track/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/paint/track/coaster/WoodenRollerCoaster.cpp @@ -3622,7 +3622,7 @@ static void WoodenRCTrackLeftVerticalLoop( break; } MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 8, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 8, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -3644,25 +3644,25 @@ static void WoodenRCTrackLeftVerticalLoop( PaintAddImageAsParentRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(23454), { 0, 0, height }, { 32, 26, 3 }); MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 20, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 20, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(23462), { 0, 14, height }, { 32, 2, 63 }); MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 9, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 9, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(23459), { 0, 6, height }, { 32, 26, 3 }); MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 16, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 16, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(23467), { 0, 6, height }, { 32, 26, 3 }); MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 16, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 16, height, session.SupportColours); break; } PaintUtilSetSegmentSupportHeight( @@ -3824,25 +3824,25 @@ static void WoodenRCTrackLeftVerticalLoop( PaintAddImageAsParentRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(23459), { 0, 6, height }, { 32, 26, 3 }); MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 16, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 16, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(23467), { 0, 6, height }, { 32, 26, 3 }); MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 16, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 16, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(23454), { 0, 0, height }, { 32, 26, 3 }); MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 20, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 20, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(23462), { 0, 14, height }, { 32, 2, 63 }); MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 9, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 9, height, session.SupportColours); break; } PaintUtilSetSegmentSupportHeight( @@ -3876,7 +3876,7 @@ static void WoodenRCTrackLeftVerticalLoop( break; } MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 8, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 8, height, session.SupportColours); switch (direction) { case 1: @@ -3927,7 +3927,7 @@ static void WoodenRCTrackRightVerticalLoop( break; } MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 8, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 8, height, session.SupportColours); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TunnelType::SquareSlopeStart); @@ -3941,25 +3941,25 @@ static void WoodenRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(23483), { 0, 6, height }, { 32, 26, 3 }); MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 16, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 16, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(23475), { 0, 6, height }, { 32, 26, 3 }); MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 16, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 16, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(23478), { 0, 14, height }, { 32, 2, 63 }); MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 9, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 9, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(23470), { 0, 0, height }, { 32, 26, 3 }); MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 20, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 20, height, session.SupportColours); break; } PaintUtilSetGeneralSupportHeight(session, height + 72); @@ -4081,25 +4081,25 @@ static void WoodenRCTrackRightVerticalLoop( PaintAddImageAsParentRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(23478), { 0, 14, height }, { 32, 2, 63 }); MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 9, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 9, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(23470), { 0, 0, height }, { 32, 26, 3 }); MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 20, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 20, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(23483), { 0, 6, height }, { 32, 26, 3 }); MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 16, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 16, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(23475), { 0, 6, height }, { 32, 26, 3 }); MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 16, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 16, height, session.SupportColours); break; } PaintUtilSetGeneralSupportHeight(session, height + 72); @@ -4125,7 +4125,7 @@ static void WoodenRCTrackRightVerticalLoop( break; } MetalASupportsPaintSetup( - session, MetalSupportGraphic::Boxed, MetalSupportPlace::Centre, 8, height, session.SupportColours); + session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 8, height, session.SupportColours); switch (direction) { case 1: diff --git a/src/openrct2/paint/track/gentle/MonorailCycles.cpp b/src/openrct2/paint/track/gentle/MonorailCycles.cpp index f7e0888d90..0a2e736e76 100644 --- a/src/openrct2/paint/track/gentle/MonorailCycles.cpp +++ b/src/openrct2/paint/track/gentle/MonorailCycles.cpp @@ -456,22 +456,6 @@ static void PaintMonorailCyclesTrackSBendLeft( { PaintUtilPushTunnelLeft(session, height, TunnelType::StandardFlat); } - - switch (trackSequence) - { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::TopLeftSide, 0, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - } } else { @@ -479,22 +463,22 @@ static void PaintMonorailCyclesTrackSBendLeft( { PaintUtilPushTunnelRight(session, height, TunnelType::StandardFlat); } + } - switch (trackSequence) - { - case 0: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::TopRightSide, 0, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height - 2, session.SupportColours); - break; - } + switch (trackSequence) + { + case 0: + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); + break; + case 1: + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::TopLeftSide, direction & 1, 0, height, session.SupportColours); + break; + case 3: + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); + break; } switch (trackSequence) @@ -576,22 +560,6 @@ static void PaintMonorailCyclesTrackSBendRight( { PaintUtilPushTunnelLeft(session, height, TunnelType::StandardFlat); } - - switch (trackSequence) - { - case 0: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::BottomRightSide, 0, height - 2, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, supportType.metal, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - } } else { @@ -599,23 +567,22 @@ static void PaintMonorailCyclesTrackSBendRight( { PaintUtilPushTunnelRight(session, height, TunnelType::StandardFlat); } - - switch (trackSequence) - { - case 0: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - case 1: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::BottomLeftSide, 0, height, - session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportGraphic::StickAlt, MetalSupportPlace::Centre, 0, height, session.SupportColours); - break; - } + } + switch (trackSequence) + { + case 0: + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); + break; + case 1: + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::BottomRightSide, direction & 1, 0, height - 2, + session.SupportColours); + break; + case 3: + MetalASupportsPaintSetupRotated( + session, supportType.metal, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); + break; } switch (trackSequence) diff --git a/src/openrct2/paint/track/thrill/MagicCarpet.cpp b/src/openrct2/paint/track/thrill/MagicCarpet.cpp index 11e10dfdd8..0d8732fc47 100644 --- a/src/openrct2/paint/track/thrill/MagicCarpet.cpp +++ b/src/openrct2/paint/track/thrill/MagicCarpet.cpp @@ -224,20 +224,7 @@ static void PaintMagicCarpet( { case 0: case 2: - if (direction & 1) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Tubes, MetalSupportPlace::TopRightSide, 0, height, session.SupportColours); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Tubes, MetalSupportPlace::BottomLeftSide, 0, height, session.SupportColours); - } - else - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Tubes, MetalSupportPlace::TopLeftSide, 0, height, session.SupportColours); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Tubes, MetalSupportPlace::BottomRightSide, 0, height, session.SupportColours); - } + DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Tubes); const StationObject* stationObject = ride.GetStationObject(); if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) diff --git a/src/openrct2/paint/track/thrill/SwingingInverterShip.cpp b/src/openrct2/paint/track/thrill/SwingingInverterShip.cpp index ce1afa65a7..e29bd107f3 100644 --- a/src/openrct2/paint/track/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/paint/track/thrill/SwingingInverterShip.cpp @@ -138,20 +138,7 @@ static void PaintSwingingInverterShip( if (relativeTrackSequence != 1 && relativeTrackSequence != 3) { - if (direction & 1) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Tubes, MetalSupportPlace::TopRightSide, 0, height, session.SupportColours); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Tubes, MetalSupportPlace::BottomLeftSide, 0, height, session.SupportColours); - } - else - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Tubes, MetalSupportPlace::TopLeftSide, 0, height, session.SupportColours); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Tubes, MetalSupportPlace::BottomRightSide, 0, height, session.SupportColours); - } + DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Tubes); if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { diff --git a/src/openrct2/paint/track/thrill/SwingingShip.cpp b/src/openrct2/paint/track/thrill/SwingingShip.cpp index 15512d7d5d..537363e518 100644 --- a/src/openrct2/paint/track/thrill/SwingingShip.cpp +++ b/src/openrct2/paint/track/thrill/SwingingShip.cpp @@ -169,29 +169,13 @@ static void PaintSwingingShip( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); } - else if (direction & 1) - { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Tubes, MetalSupportPlace::TopRightSide, 0, height, session.SupportColours); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Tubes, MetalSupportPlace::BottomLeftSide, 0, height, session.SupportColours); - - if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) - { - imageId = session.SupportColours.WithIndex(SPR_STATION_BASE_A_NW_SE); - PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); - } - } else { - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Tubes, MetalSupportPlace::TopLeftSide, 0, height, session.SupportColours); - MetalASupportsPaintSetup( - session, MetalSupportGraphic::Tubes, MetalSupportPlace::BottomRightSide, 0, height, session.SupportColours); - + DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Tubes); if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { - imageId = session.SupportColours.WithIndex(SPR_STATION_BASE_A_SW_NE); + ImageIndex base = (direction & 1) ? SPR_STATION_BASE_A_NW_SE : SPR_STATION_BASE_A_SW_NE; + imageId = session.SupportColours.WithIndex(base); PaintAddImageAsParent(session, imageId, { 0, 0, height }, { 32, 32, 1 }); } } diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index cad7b77609..a6be085795 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -1910,7 +1910,8 @@ void TrackPaintUtilLeftCorkscrewUpSupports(PaintSession& session, Direction dire direction), 0xFFFF, 0); } - MetalASupportsPaintSetup(session, MetalSupportGraphic::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Tubes, MetalSupportPlace::Centre, direction, 0, height, session.SupportColours); if (direction != 2) { PaintUtilSetSegmentSupportHeight(